diff options
Diffstat (limited to 'spec/ruby/shared/string')
-rw-r--r-- | spec/ruby/shared/string/times.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/shared/string/times.rb b/spec/ruby/shared/string/times.rb index 6827db2271..4dd59884c8 100644 --- a/spec/ruby/shared/string/times.rb +++ b/spec/ruby/shared/string/times.rb @@ -20,10 +20,16 @@ describe :string_times, shared: true do it "raises an ArgumentError when given integer is negative" do -> { @object.call("cool", -3) }.should raise_error(ArgumentError) -> { @object.call("cool", -3.14) }.should raise_error(ArgumentError) + -> { @object.call("cool", min_long) }.should raise_error(ArgumentError) end it "raises a RangeError when given integer is a Bignum" do -> { @object.call("cool", 999999999999999999999) }.should raise_error(RangeError) + -> { @object.call("", 999999999999999999999) }.should raise_error(RangeError) + end + + it "works with huge long values when string is empty" do + @object.call("", max_long).should == "" end it "returns subclass instances" do |