diff options
author | Yusuke Endoh <[email protected]> | 2024-02-15 13:00:32 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2024-02-15 18:42:31 +0900 |
commit | 8259f35adc67ab34bb521f0e8a298fb00629b958 (patch) | |
tree | b7ddb8c804334616362def40f380a29b3ffca6ea /spec/ruby/core/time | |
parent | 25d74b9527cd525042ad0b612b794fa331d3a318 (diff) |
ruby-spec: Accept both a backtick and a single quote in error messages
Diffstat (limited to 'spec/ruby/core/time')
-rw-r--r-- | spec/ruby/core/time/new_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/ruby/core/time/new_spec.rb b/spec/ruby/core/time/new_spec.rb index 18d7396269..d686355270 100644 --- a/spec/ruby/core/time/new_spec.rb +++ b/spec/ruby/core/time/new_spec.rb @@ -358,7 +358,7 @@ describe "Time.new with a timezone argument" do -> { Marshal.dump(time) - }.should raise_error(NoMethodError, /undefined method `name' for/) + }.should raise_error(NoMethodError, /undefined method [`']name' for/) end end @@ -559,15 +559,15 @@ describe "Time.new with a timezone argument" do -> { Time.new("2020-012-25 00:56:17 +0900") - }.should raise_error(ArgumentError, "two digits mon is expected after `-': -012-25 00:") + }.should raise_error(ArgumentError, /\Atwo digits mon is expected after [`']-': -012-25 00:\z/) -> { Time.new("2020-2-25 00:56:17 +0900") - }.should raise_error(ArgumentError, "two digits mon is expected after `-': -2-25 00:56") + }.should raise_error(ArgumentError, /\Atwo digits mon is expected after [`']-': -2-25 00:56\z/) -> { Time.new("2020-12-215 00:56:17 +0900") - }.should raise_error(ArgumentError, "two digits mday is expected after `-': -215 00:56:") + }.should raise_error(ArgumentError, /\Atwo digits mday is expected after [`']-': -215 00:56:\z/) -> { Time.new("2020-12-25 000:56:17 +0900") @@ -579,19 +579,19 @@ describe "Time.new with a timezone argument" do -> { Time.new("2020-12-25 00:516:17 +0900") - }.should raise_error(ArgumentError, "two digits min is expected after `:': :516:17 +09") + }.should raise_error(ArgumentError, /\Atwo digits min is expected after [`']:': :516:17 \+09\z/) -> { Time.new("2020-12-25 00:6:17 +0900") - }.should raise_error(ArgumentError, "two digits min is expected after `:': :6:17 +0900") + }.should raise_error(ArgumentError, /\Atwo digits min is expected after [`']:': :6:17 \+0900\z/) -> { Time.new("2020-12-25 00:56:137 +0900") - }.should raise_error(ArgumentError, "two digits sec is expected after `:': :137 +0900") + }.should raise_error(ArgumentError, /\Atwo digits sec is expected after [`']:': :137 \+0900\z/) -> { Time.new("2020-12-25 00:56:7 +0900") - }.should raise_error(ArgumentError, "two digits sec is expected after `:': :7 +0900") + }.should raise_error(ArgumentError, /\Atwo digits sec is expected after [`']:': :7 \+0900\z/) -> { Time.new("2020-12-25 00:56. +0900") |