Sha256: 62ce552090b295511cdedd28bf9f8439fda0747360bae9f3bbe8cec060054788
Contents?: true
Size: 741 Bytes
Versions: 52
Compression:
Stored size: 741 Bytes
Contents
require File.expand_path('../../../spec_helper', __FILE__) require 'rational' describe :rational_new, :shared => true do it "is private" do Rational.private_methods.should include("new") end end describe :rational_new_bang, :shared => true 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
Version data entries
52 entries across 52 versions & 2 rubygems