summaryrefslogtreecommitdiff
path: root/spec/ruby/core/math
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2022-03-28 17:47:04 +0200
committerBenoit Daloze <[email protected]>2022-03-28 17:47:04 +0200
commit8db4f25bf4327f169902afd9ea8f4b03b65656f0 (patch)
treead61b99fb2d5ebfe9c07de8c2b5885e80d20b8e1 /spec/ruby/core/math
parentae650f0372e10cea4d695769b1fcdc23a76fdf17 (diff)
Update to ruby/spec@aaf998f
Diffstat (limited to 'spec/ruby/core/math')
-rw-r--r--spec/ruby/core/math/sqrt_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/math/sqrt_spec.rb b/spec/ruby/core/math/sqrt_spec.rb
index 779aea2a0a..918e7c3a17 100644
--- a/spec/ruby/core/math/sqrt_spec.rb
+++ b/spec/ruby/core/math/sqrt_spec.rb
@@ -27,6 +27,10 @@ describe "Math.sqrt" do
it "accepts any argument that can be coerced with Float()" do
Math.sqrt(MathSpecs::Float.new).should be_close(1.0, TOLERANCE)
end
+
+ it "raises a Math::DomainError when given a negative number" do
+ -> { Math.sqrt(-1) }.should raise_error(Math::DomainError)
+ end
end
describe "Math#sqrt" do