diff options
Diffstat (limited to 'spec/ruby/core/integer')
| -rw-r--r-- | spec/ruby/core/integer/pow_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/integer/pow_spec.rb b/spec/ruby/core/integer/pow_spec.rb index d7561baf96..4712911095 100644 --- a/spec/ruby/core/integer/pow_spec.rb +++ b/spec/ruby/core/integer/pow_spec.rb @@ -43,5 +43,9 @@ describe "Integer#pow" do it "raises a ZeroDivisionError when the given argument is 0" do -> { 2.pow(5, 0) }.should raise_error(ZeroDivisionError) end + + it "raises a RangeError when the first argument is negative and the second argument is present" do + -> { 2.pow(-5, 1) }.should raise_error(RangeError) + end end end |
