summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2015-01-17 14:31:52 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2015-01-17 14:31:52 +0900
commit48e65f5743a0e335653007afc59e3aea623ec32a (patch)
treee0f05d96831ba5b1d6b3dec3169e019313187ea6
parentcb75738e594f9d7f7d4899e0f932fcb55a9ad1e1 (diff)
downloadpsych-48e65f5743a0e335653007afc59e3aea623ec32a.tar.gz
Fix assertion regexps
`|' is a meta character, so needs to be escaped.
-rw-r--r--test/psych/test_string.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/psych/test_string.rb b/test/psych/test_string.rb
index df8fb98..4718a47 100644
--- a/test/psych/test_string.rb
+++ b/test/psych/test_string.rb
@@ -68,7 +68,7 @@ module Psych
def test_literal_when_inner_and_final_line_break
str = "Lorem ipsum\ndolor\n"
yaml = Psych.dump str, line_width: 12
- assert_match /---\s*|\n(.*\n){2}\Z/, yaml
+ assert_match /---\s*\|\n(.*\n){2}\Z/, yaml
assert_equal str, Psych.load(yaml)
end
@@ -76,7 +76,7 @@ module Psych
def test_literal_strip_when_inner_line_break_and_no_final_line_break
str = "Lorem ipsum\ndolor"
yaml = Psych.dump str, line_width: 12
- assert_match /---\s*|-\n(.*\n){2}\Z/, yaml
+ assert_match /---\s*\|-\n(.*\n){2}\Z/, yaml
assert_equal str, Psych.load(yaml)
end