Sha256: 44ca60e4079b231c8a9a2177ccca2b14f3ed8fa96d8506582c8475dfbf7309ac
Contents?: true
Size: 687 Bytes
Versions: 2
Compression:
Stored size: 687 Bytes
Contents
ruby_version_is ""..."1.9" do describe "Rational.new" do it "is private" do Rational.should have_private_method(:new) end end describe "Rational.new!" do it "returns a Rational with the passed numerator and denominator not reduced to their lowest terms" do Rational.new!(2, 4).should_not eql(Rational(1, 4)) Rational.new!(6, 8).should_not eql(Rational(3, 4)) Rational.new!(-5, 10).should_not eql(Rational(-1, 2)) end it "does not check for divisions by 0" do lambda { Rational.new!(4, 0) }.should_not raise_error(ZeroDivisionError) lambda { Rational.new!(0, 0) }.should_not raise_error(ZeroDivisionError) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubysl-rational-2.0.1 | spec/new_spec.rb |
rubysl-rational-1.0.0 | spec/new_spec.rb |