diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-07-27 12:40:09 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-07-27 12:40:09 +0200 |
commit | 5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch) | |
tree | 05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/core/time/at_spec.rb | |
parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/time/at_spec.rb')
-rw-r--r-- | spec/ruby/core/time/at_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/ruby/core/time/at_spec.rb b/spec/ruby/core/time/at_spec.rb index 1493012676..592b331a28 100644 --- a/spec/ruby/core/time/at_spec.rb +++ b/spec/ruby/core/time/at_spec.rb @@ -71,11 +71,11 @@ describe "Time.at" do describe "passed non-Time, non-Numeric" do it "raises a TypeError with a String argument" do - lambda { Time.at("0") }.should raise_error(TypeError) + -> { Time.at("0") }.should raise_error(TypeError) end it "raises a TypeError with a nil argument" do - lambda { Time.at(nil) }.should raise_error(TypeError) + -> { Time.at(nil) }.should raise_error(TypeError) end describe "with an argument that responds to #to_int" do @@ -127,20 +127,20 @@ describe "Time.at" do describe "passed [Integer, nil]" do it "raises a TypeError" do - lambda { Time.at(0, nil) }.should raise_error(TypeError) + -> { Time.at(0, nil) }.should raise_error(TypeError) end end describe "passed [Integer, String]" do it "raises a TypeError" do - lambda { Time.at(0, "0") }.should raise_error(TypeError) + -> { Time.at(0, "0") }.should raise_error(TypeError) end end describe "passed [Time, Integer]" do # #8173 it "raises a TypeError" do - lambda { Time.at(Time.now, 500000) }.should raise_error(TypeError) + -> { Time.at(Time.now, 500000) }.should raise_error(TypeError) end end @@ -178,15 +178,15 @@ describe "Time.at" do context "not supported format" do it "raises ArgumentError" do - ->() { Time.at(0, 123456, 2) }.should raise_error(ArgumentError) - ->() { Time.at(0, 123456, nil) }.should raise_error(ArgumentError) - ->() { Time.at(0, 123456, :invalid) }.should raise_error(ArgumentError) + -> { Time.at(0, 123456, 2) }.should raise_error(ArgumentError) + -> { Time.at(0, 123456, nil) }.should raise_error(ArgumentError) + -> { Time.at(0, 123456, :invalid) }.should raise_error(ArgumentError) end it "does not try to convert format to Symbol with #to_sym" do format = "usec" format.should_not_receive(:to_sym) - -> () { Time.at(0, 123456, format) }.should raise_error(ArgumentError) + -> { Time.at(0, 123456, format) }.should raise_error(ArgumentError) end end |