summaryrefslogtreecommitdiff
path: root/spec/ruby/core/time/getlocal_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-07-27 12:40:09 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-07-27 12:40:09 +0200
commit5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch)
tree05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/core/time/getlocal_spec.rb
parenta06301b103371b0b7da8eaca26ba744961769f99 (diff)
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/time/getlocal_spec.rb')
-rw-r--r--spec/ruby/core/time/getlocal_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/ruby/core/time/getlocal_spec.rb b/spec/ruby/core/time/getlocal_spec.rb
index 8b6a21bb58..7196577dab 100644
--- a/spec/ruby/core/time/getlocal_spec.rb
+++ b/spec/ruby/core/time/getlocal_spec.rb
@@ -77,24 +77,24 @@ describe "Time#getlocal" do
it "raises ArgumentError if the String argument is not of the form (+|-)HH:MM" do
t = Time.now
- lambda { t.getlocal("3600") }.should raise_error(ArgumentError)
+ -> { t.getlocal("3600") }.should raise_error(ArgumentError)
end
it "raises ArgumentError if the String argument is not in an ASCII-compatible encoding" do
t = Time.now
- lambda { t.getlocal("-01:00".encode("UTF-16LE")) }.should raise_error(ArgumentError)
+ -> { t.getlocal("-01:00".encode("UTF-16LE")) }.should raise_error(ArgumentError)
end
it "raises ArgumentError if the argument represents a value less than or equal to -86400 seconds" do
t = Time.new
t.getlocal(-86400 + 1).utc_offset.should == (-86400 + 1)
- lambda { t.getlocal(-86400) }.should raise_error(ArgumentError)
+ -> { t.getlocal(-86400) }.should raise_error(ArgumentError)
end
it "raises ArgumentError if the argument represents a value greater than or equal to 86400 seconds" do
t = Time.new
t.getlocal(86400 - 1).utc_offset.should == (86400 - 1)
- lambda { t.getlocal(86400) }.should raise_error(ArgumentError)
+ -> { t.getlocal(86400) }.should raise_error(ArgumentError)
end
ruby_version_is "2.6" do
@@ -116,7 +116,7 @@ describe "Time#getlocal" do
time
end
- lambda {
+ -> {
Time.utc(2000, 1, 1, 12, 0, 0).getlocal(zone).should be_kind_of(Time)
}.should_not raise_error
end
@@ -127,7 +127,7 @@ describe "Time#getlocal" do
time
end
- lambda {
+ -> {
Time.utc(2000, 1, 1, 12, 0, 0).getlocal(zone)
}.should raise_error(TypeError, /can't convert \w+ into an exact number/)
end
@@ -138,7 +138,7 @@ describe "Time#getlocal" do
time
end
- lambda {
+ -> {
Time.utc(2000, 1, 1, 12, 0, 0).getlocal(zone).should be_kind_of(Time)
}.should_not raise_error
end
@@ -158,7 +158,7 @@ describe "Time#getlocal" do
[Object.new, [], {}, :"some zone"].each do |zone|
time = TimeSpecs::TimeWithFindTimezone.utc(2000, 1, 1, 12, 0, 0)
- lambda {
+ -> {
time.getlocal(zone)
}.should raise_error(TypeError, /can't convert \w+ into an exact number/)
end