Sha256: 839f61bd589b281bdc1e326df4816c26e478b9e2d75c1a98bc9ad76c2af87e7e

Contents?: true

Size: 979 Bytes

Versions: 17

Compression:

Stored size: 979 Bytes

Contents

require 'spec_helper'

describe RSpecCandy do
  describe 'matchers' do
    describe 'be_same_number_as' do

      it 'should correctly compare Fixnums and Floats' do
        1.should be_same_number_as(1.0)
        2.should_not be_same_number_as(1.0)
        -1.should be_same_number_as(-1.0)
        -2.should_not be_same_number_as(-1.0)
      end

      it 'should correctly compare Fixnums and BigDecimals' do
        1.should be_same_number_as(BigDecimal('1.0'))
        2.should_not be_same_number_as(BigDecimal('1.0'))
        -1.should be_same_number_as(BigDecimal('-1.0'))
        -2.should_not be_same_number_as(BigDecimal('-1.0'))
      end

      it 'should correctly compare Floats and BigDecimals' do
        1.1.should be_same_number_as(BigDecimal('1.1'))
        2.1.should_not be_same_number_as(BigDecimal('1.1'))
        -1.1.should be_same_number_as(BigDecimal('-1.1'))
        -2.1.should_not be_same_number_as(BigDecimal('-1.1'))
      end

    end
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rspec_candy-0.5.1 spec/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.5.0 spec/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.4.1 spec/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.4.0 spec/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.3.1 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.3.0 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.10 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.9 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.8 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.7 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.6 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.5 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.4 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.3 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.2 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.1 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb
rspec_candy-0.2.0 spec/shared/rspec_candy/matchers/be_same_number_as_spec.rb