summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-03-03 14:50:48 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-03-03 14:50:48 +0900
commitbb5b2644c1b39c54bbe4250936ed4023247c1aab (patch)
treebbfa5298923f4095b1c79c2a7ee867c9a4acd20b /test
parent25a7b47d2a2e36ecb80beb797a9056fb1313ae40 (diff)
downloadpsych-bb5b2644c1b39c54bbe4250936ed4023247c1aab.zip
Added parentheses for regex assertions
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_date_time.rb2
-rw-r--r--test/psych/test_string.rb14
2 files changed, 8 insertions, 8 deletions
diff --git a/test/psych/test_date_time.rb b/test/psych/test_date_time.rb
index 433fbf3..443669d 100644
--- a/test/psych/test_date_time.rb
+++ b/test/psych/test_date_time.rb
@@ -5,7 +5,7 @@ require 'date'
module Psych
class TestDateTime < TestCase
def test_negative_year
- time = Time.utc -1, 12, 16
+ time = Time.utc(-1, 12, 16)
assert_cycle time
end
diff --git a/test/psych/test_string.rb b/test/psych/test_string.rb
index 25c6353..cf61a90 100644
--- a/test/psych/test_string.rb
+++ b/test/psych/test_string.rb
@@ -33,28 +33,28 @@ module Psych
def test_doublequotes_when_there_is_a_single
str = "@123'abc"
yaml = Psych.dump str
- assert_match /---\s*"/, yaml
+ assert_match(/---\s*"/, yaml)
assert_equal str, Psych.load(yaml)
end
def test_plain_when_shorten_than_line_width_and_no_final_line_break
str = "Lorem ipsum"
yaml = Psych.dump str, line_width: 12
- assert_match /---\s*[^>|]+\n/, yaml
+ assert_match(/---\s*[^>|]+\n/, yaml)
assert_equal str, Psych.load(yaml)
end
def test_plain_when_shorten_than_line_width_and_with_final_line_break
str = "Lorem ipsum\n"
yaml = Psych.dump str, line_width: 12
- assert_match /---\s*[^>|]+\n/, yaml
+ assert_match(/---\s*[^>|]+\n/, yaml)
assert_equal str, Psych.load(yaml)
end
def test_folded_when_longer_than_line_width_and_with_final_line_break
str = "Lorem ipsum dolor sit\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
@@ -62,7 +62,7 @@ module Psych
def test_folded_strip_when_longer_than_line_width_and_no_newlines
str = "Lorem ipsum dolor sit amet, consectetur"
yaml = Psych.dump str, line_width: 12
- assert_match /---\s*>-\n(.*\n){3}\Z/, yaml
+ assert_match(/---\s*>-\n(.*\n){3}\Z/, yaml)
assert_equal str, Psych.load(yaml)
end
@@ -72,7 +72,7 @@ module Psych
"Lorem ipsum\nZolor\n",
].each do |str|
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
end
@@ -84,7 +84,7 @@ module Psych
"Lorem ipsum\nZolor",
].each do |str|
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
end