summaryrefslogtreecommitdiff
path: root/spec/ruby/library/date/shared
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/library/date/shared
parenta06301b103371b0b7da8eaca26ba744961769f99 (diff)
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/library/date/shared')
-rw-r--r--spec/ruby/library/date/shared/civil.rb16
-rw-r--r--spec/ruby/library/date/shared/commercial.rb18
2 files changed, 17 insertions, 17 deletions
diff --git a/spec/ruby/library/date/shared/civil.rb b/spec/ruby/library/date/shared/civil.rb
index 47dbed49fc..4c8ba23622 100644
--- a/spec/ruby/library/date/shared/civil.rb
+++ b/spec/ruby/library/date/shared/civil.rb
@@ -36,14 +36,14 @@ describe :date_civil, shared: true do
end
it "doesn't create dates for invalid arguments" do
- lambda { Date.send(@method, 2000, 13, 31) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 2000, 12, 32) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 2000, 2, 30) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 1900, 2, 29) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 2000, 2, 29) }.should_not raise_error(ArgumentError)
-
- lambda { Date.send(@method, 1582, 10, 14) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 1582, 10, 15) }.should_not raise_error(ArgumentError)
+ -> { Date.send(@method, 2000, 13, 31) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 2000, 12, 32) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 2000, 2, 30) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 1900, 2, 29) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 2000, 2, 29) }.should_not raise_error(ArgumentError)
+
+ -> { Date.send(@method, 1582, 10, 14) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 1582, 10, 15) }.should_not raise_error(ArgumentError)
end
diff --git a/spec/ruby/library/date/shared/commercial.rb b/spec/ruby/library/date/shared/commercial.rb
index 354a5d5cd0..39c9af47b6 100644
--- a/spec/ruby/library/date/shared/commercial.rb
+++ b/spec/ruby/library/date/shared/commercial.rb
@@ -25,15 +25,15 @@ describe :date_commercial, shared: true do
end
it "creates only Date objects for valid weeks" do
- lambda { Date.send(@method, 2004, 53, 1) }.should_not raise_error(ArgumentError)
- lambda { Date.send(@method, 2004, 53, 0) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 2004, 53, 8) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 2004, 54, 1) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 2004, 0, 1) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 2004, 53, 1) }.should_not raise_error(ArgumentError)
+ -> { Date.send(@method, 2004, 53, 0) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 2004, 53, 8) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 2004, 54, 1) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 2004, 0, 1) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 2003, 52, 1) }.should_not raise_error(ArgumentError)
- lambda { Date.send(@method, 2003, 53, 1) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 2003, 52, 0) }.should raise_error(ArgumentError)
- lambda { Date.send(@method, 2003, 52, 8) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 2003, 52, 1) }.should_not raise_error(ArgumentError)
+ -> { Date.send(@method, 2003, 53, 1) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 2003, 52, 0) }.should raise_error(ArgumentError)
+ -> { Date.send(@method, 2003, 52, 8) }.should raise_error(ArgumentError)
end
end