summaryrefslogtreecommitdiff
path: root/spec/ruby/core/numeric
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-08 19:43:27 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-01 15:36:20 +0900
commit826f44834fe11f3f9c52343443a15b6c83466889 (patch)
treef2c2abed62db1c750515cd8b0fbac6442b6d4200 /spec/ruby/core/numeric
parent3a2073e61b6ccce6d07d31ebd89d4c385b9a55f2 (diff)
Drop support for ruby 2.4 from ruby/spec
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2892
Diffstat (limited to 'spec/ruby/core/numeric')
-rw-r--r--spec/ruby/core/numeric/shared/step.rb64
1 files changed, 24 insertions, 40 deletions
diff --git a/spec/ruby/core/numeric/shared/step.rb b/spec/ruby/core/numeric/shared/step.rb
index 364d4769ad..fac79b3e63 100644
--- a/spec/ruby/core/numeric/shared/step.rb
+++ b/spec/ruby/core/numeric/shared/step.rb
@@ -224,33 +224,25 @@ describe :numeric_step, :shared => true do
end
describe "when step is a String" do
- error = nil
- ruby_version_is "2.4"..."2.5" do
- error = TypeError
- end
- ruby_version_is "2.5" do
- error = ArgumentError
- end
-
describe "with self and stop as Fixnums" do
- it "raises an #{error} when step is a numeric representation" do
- -> { @step.call(1, 5, "1") {} }.should raise_error(error)
- -> { @step.call(1, 5, "0.1") {} }.should raise_error(error)
- -> { @step.call(1, 5, "1/3") {} }.should raise_error(error)
+ it "raises an ArgumentError when step is a numeric representation" do
+ -> { @step.call(1, 5, "1") {} }.should raise_error(ArgumentError)
+ -> { @step.call(1, 5, "0.1") {} }.should raise_error(ArgumentError)
+ -> { @step.call(1, 5, "1/3") {} }.should raise_error(ArgumentError)
end
- it "raises an #{error} with step as an alphanumeric string" do
- -> { @step.call(1, 5, "foo") {} }.should raise_error(error)
+ it "raises an ArgumentError with step as an alphanumeric string" do
+ -> { @step.call(1, 5, "foo") {} }.should raise_error(ArgumentError)
end
end
describe "with self and stop as Floats" do
- it "raises an #{error} when step is a numeric representation" do
- -> { @step.call(1.1, 5.1, "1") {} }.should raise_error(error)
- -> { @step.call(1.1, 5.1, "0.1") {} }.should raise_error(error)
- -> { @step.call(1.1, 5.1, "1/3") {} }.should raise_error(error)
+ it "raises an ArgumentError when step is a numeric representation" do
+ -> { @step.call(1.1, 5.1, "1") {} }.should raise_error(ArgumentError)
+ -> { @step.call(1.1, 5.1, "0.1") {} }.should raise_error(ArgumentError)
+ -> { @step.call(1.1, 5.1, "1/3") {} }.should raise_error(ArgumentError)
end
- it "raises an #{error} with step as an alphanumeric string" do
- -> { @step.call(1.1, 5.1, "foo") {} }.should raise_error(error)
+ it "raises an ArgumentError with step as an alphanumeric string" do
+ -> { @step.call(1.1, 5.1, "foo") {} }.should raise_error(ArgumentError)
end
end
end
@@ -302,33 +294,25 @@ describe :numeric_step, :shared => true do
describe "returned Enumerator" do
describe "size" do
describe "when step is a String" do
- error = nil
- ruby_version_is "2.4"..."2.5" do
- error = TypeError
- end
- ruby_version_is "2.5" do
- error = ArgumentError
- end
-
describe "with self and stop as Fixnums" do
- it "raises an #{error} when step is a numeric representation" do
- -> { @step.call(1, 5, "1").size }.should raise_error(error)
- -> { @step.call(1, 5, "0.1").size }.should raise_error(error)
- -> { @step.call(1, 5, "1/3").size }.should raise_error(error)
+ it "raises an ArgumentError when step is a numeric representation" do
+ -> { @step.call(1, 5, "1").size }.should raise_error(ArgumentError)
+ -> { @step.call(1, 5, "0.1").size }.should raise_error(ArgumentError)
+ -> { @step.call(1, 5, "1/3").size }.should raise_error(ArgumentError)
end
- it "raises an #{error} with step as an alphanumeric string" do
- -> { @step.call(1, 5, "foo").size }.should raise_error(error)
+ it "raises an ArgumentError with step as an alphanumeric string" do
+ -> { @step.call(1, 5, "foo").size }.should raise_error(ArgumentError)
end
end
describe "with self and stop as Floats" do
- it "raises an #{error} when step is a numeric representation" do
- -> { @step.call(1.1, 5.1, "1").size }.should raise_error(error)
- -> { @step.call(1.1, 5.1, "0.1").size }.should raise_error(error)
- -> { @step.call(1.1, 5.1, "1/3").size }.should raise_error(error)
+ it "raises an ArgumentError when step is a numeric representation" do
+ -> { @step.call(1.1, 5.1, "1").size }.should raise_error(ArgumentError)
+ -> { @step.call(1.1, 5.1, "0.1").size }.should raise_error(ArgumentError)
+ -> { @step.call(1.1, 5.1, "1/3").size }.should raise_error(ArgumentError)
end
- it "raises an #{error} with step as an alphanumeric string" do
- -> { @step.call(1.1, 5.1, "foo").size }.should raise_error(error)
+ it "raises an ArgumentError with step as an alphanumeric string" do
+ -> { @step.call(1.1, 5.1, "foo").size }.should raise_error(ArgumentError)
end
end
end