diff options
Diffstat (limited to 'spec/ruby/library/date/shared')
-rw-r--r-- | spec/ruby/library/date/shared/civil.rb | 16 | ||||
-rw-r--r-- | spec/ruby/library/date/shared/commercial.rb | 18 |
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 |