Sha256: a6d8f45442a936f664c0d29e0236ff308b7612d78649b33a4a8fbbe168503597

Contents?: true

Size: 748 Bytes

Versions: 83

Compression:

Stored size: 748 Bytes

Contents

require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper'

describe "Fixnum#==" do
  it "returns true if self has the same value as other" do
    (1 == 1).should == true
    (9 == 5).should == false
    
    # Actually, these call Float#==, Bignum#== etc.
    (9 == 9.0).should == true
    (9 == 9.01).should == false
    
    (10 == bignum_value).should == false
  end
  
  it "calls 'other == self' if the given argument is not a Fixnum" do
    (1 == '*').should == false
    
    obj = mock('one other')
    obj.should_receive(:==).any_number_of_times.and_return(false)
    1.should_not == obj

    obj = mock('another')
    obj.should_receive(:==).any_number_of_times.and_return(true)
    2.should == obj
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
rhodes-3.1.1 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.1.1.beta spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.1.0 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.1.0.beta.5 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.1.0.beta.4 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.1.0.beta.3 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.1.0.beta.2 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.1.0.beta.1 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.2 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.2.beta.1 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.1 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.1.beta.8 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.1.beta.7 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.1.beta.6 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.1.beta.5 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.1.beta.4 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.1.beta.3 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.1.beta.2 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.0 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb
rhodes-3.0.0.beta.7 spec/framework_spec/app/spec/core/fixnum/equal_value_spec.rb