summaryrefslogtreecommitdiff
path: root/spec/ruby/core/time/shared
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/time/shared')
-rw-r--r--spec/ruby/core/time/shared/gmtime.rb2
-rw-r--r--spec/ruby/core/time/shared/time_params.rb28
2 files changed, 15 insertions, 15 deletions
diff --git a/spec/ruby/core/time/shared/gmtime.rb b/spec/ruby/core/time/shared/gmtime.rb
index e684a1fd95..5ed64c2ab6 100644
--- a/spec/ruby/core/time/shared/gmtime.rb
+++ b/spec/ruby/core/time/shared/gmtime.rb
@@ -26,7 +26,7 @@ describe :time_gmtime, shared: true do
with_timezone("CST", -6) do
time = Time.now
time.freeze
- lambda { time.send(@method) }.should raise_error(RuntimeError)
+ -> { time.send(@method) }.should raise_error(RuntimeError)
end
end
end
diff --git a/spec/ruby/core/time/shared/time_params.rb b/spec/ruby/core/time/shared/time_params.rb
index 39245116b0..63d0dbc120 100644
--- a/spec/ruby/core/time/shared/time_params.rb
+++ b/spec/ruby/core/time/shared/time_params.rb
@@ -30,7 +30,7 @@ describe :time_params, shared: true do
end
it "raises a TypeError if the year is nil" do
- lambda { Time.send(@method, nil) }.should raise_error(TypeError)
+ -> { Time.send(@method, nil) }.should raise_error(TypeError)
end
it "accepts nil month, day, hour, minute, and second" do
@@ -145,41 +145,41 @@ describe :time_params, shared: true do
end
it "raises an ArgumentError for out of range month" do
- lambda {
+ -> {
Time.send(@method, 2008, 13, 31, 23, 59, 59)
}.should raise_error(ArgumentError)
end
it "raises an ArgumentError for out of range day" do
- lambda {
+ -> {
Time.send(@method, 2008, 12, 32, 23, 59, 59)
}.should raise_error(ArgumentError)
end
it "raises an ArgumentError for out of range hour" do
- lambda {
+ -> {
Time.send(@method, 2008, 12, 31, 25, 59, 59)
}.should raise_error(ArgumentError)
end
it "raises an ArgumentError for out of range minute" do
- lambda {
+ -> {
Time.send(@method, 2008, 12, 31, 23, 61, 59)
}.should raise_error(ArgumentError)
end
it "raises an ArgumentError for out of range second" do
- lambda {
+ -> {
Time.send(@method, 2008, 12, 31, 23, 59, 61)
}.should raise_error(ArgumentError)
end
it "raises ArgumentError when given 9 arguments" do
- lambda { Time.send(@method, *[0]*9) }.should raise_error(ArgumentError)
+ -> { Time.send(@method, *[0]*9) }.should raise_error(ArgumentError)
end
it "raises ArgumentError when given 11 arguments" do
- lambda { Time.send(@method, *[0]*11) }.should raise_error(ArgumentError)
+ -> { Time.send(@method, *[0]*11) }.should raise_error(ArgumentError)
end
it "returns subclass instances" do
@@ -202,23 +202,23 @@ describe :time_params_10_arg, shared: true do
end
it "raises an ArgumentError for out of range values" do
- lambda {
+ -> {
Time.send(@method, 61, 59, 23, 31, 12, 2008, :ignored, :ignored, :ignored, :ignored)
}.should raise_error(ArgumentError) # sec
- lambda {
+ -> {
Time.send(@method, 59, 61, 23, 31, 12, 2008, :ignored, :ignored, :ignored, :ignored)
}.should raise_error(ArgumentError) # min
- lambda {
+ -> {
Time.send(@method, 59, 59, 25, 31, 12, 2008, :ignored, :ignored, :ignored, :ignored)
}.should raise_error(ArgumentError) # hour
- lambda {
+ -> {
Time.send(@method, 59, 59, 23, 32, 12, 2008, :ignored, :ignored, :ignored, :ignored)
}.should raise_error(ArgumentError) # day
- lambda {
+ -> {
Time.send(@method, 59, 59, 23, 31, 13, 2008, :ignored, :ignored, :ignored, :ignored)
}.should raise_error(ArgumentError) # month
end
@@ -231,7 +231,7 @@ describe :time_params_microseconds, shared: true do
end
it "raises an ArgumentError for out of range microsecond" do
- lambda { Time.send(@method, 2000, 1, 1, 20, 15, 1, 1000000) }.should raise_error(ArgumentError)
+ -> { Time.send(@method, 2000, 1, 1, 20, 15, 1, 1000000) }.should raise_error(ArgumentError)
end
it "handles fractional microseconds as a Float" do