Sha256: 6e090df85804e701e41093b4339d49c4522a2edbc9ab1fa555113e87688777ba

Contents?: true

Size: 400 Bytes

Versions: 52

Compression:

Stored size: 400 Bytes

Contents

require File.expand_path('../../../spec_helper', __FILE__)
require 'rational'

describe :rational_to_i, :shared => true do
  it "converts self to an Integer by truncation" do
    Rational(7, 4).to_i.should eql(1)
    Rational(11, 4).to_i.should eql(2)
  end

  ruby_bug "#", "1.8.6" do
    it "converts self to an Integer by truncation" do
      Rational(-7, 4).to_i.should eql(-1)
    end
  end
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
rhodes-3.3.4 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.3 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.3.beta.4 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.3.beta.3 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.3.beta.2 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.3.beta.1 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.2 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.2.beta.7 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.2.beta.6 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.2.beta.5 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.2.beta.4 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.2.beta.3 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.2.beta.2 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.2.beta.1 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.1 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.0 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.0.beta.3 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.0.beta.2 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.3.0.beta.1 spec/framework_spec/app/spec/shared/rational/to_i.rb
rhodes-3.2.3 spec/framework_spec/app/spec/shared/rational/to_i.rb