Permalink
Browse files

Complex#/: ZeroDivisionError if denominator is 0.0 on 1.9

  • Loading branch information...
1 parent 3a0934b commit 078ab21fd17977cf62c751872e0ac25a15f20411 @runpaint runpaint committed Jul 1, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 shared/complex/divide.rb
@@ -45,9 +45,9 @@
end
ruby_version_is "1.9" do
- it "returns (Infinity+Infinity*i) when given zero" do
- (Complex(20, 40) / 0.0).inspect.should == "(Infinity+Infinity*i)"
- (Complex(-20, -40) / 0.0).inspect.should == "(-Infinity-Infinity*i)"
+ it "raises a ZeroDivisionError when given 0.0" do
+ lambda { Complex(20, 40) / 0.0 }.should raise_error(ZeroDivisionError)
+ lambda { Complex(-20, -40) / 0.0 }.should raise_error(ZeroDivisionError)
end
end
end

0 comments on commit 078ab21

Please sign in to comment.