Sha256: 2f9426edf8e3bee4d2cc6d8497245a1bcabd1254203d4a427014762622bc8923

Contents?: true

Size: 344 Bytes

Versions: 6

Compression:

Stored size: 344 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Rational" do
  describe "#reciprocal" do
    it "should invert the numerator and denominator" do
      rational = Rational('1/2')
      inverted = rational.reciprocal
      inverted.should == Rational('2/1')
      rational.should == Rational('1/2')
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rodders-1.0.0 spec/Rational_spec.rb
rodders-0.3.0 spec/Rational_spec.rb
rodders-0.2.0 spec/Rational_spec.rb
rodders-0.1.2 spec/Rational_spec.rb
rodders-0.1.1 spec/Rational_spec.rb
rodders-0.1.0 spec/Rational_spec.rb