Sha256: d16b11501b1b7a78c864ba016cbe2a5f74bef80737d94bc49108b83f3d43b2ab

Contents?: true

Size: 607 Bytes

Versions: 3

Compression:

Stored size: 607 Bytes

Contents

require 'spec_helper'
module Qrb
  describe SetType, "equality" do

    let(:type) { SetType.new(intType)   }
    let(:type2){ SetType.new(intType)   }
    let(:type3){ SetType.new(floatType) }

    it 'should apply structural equality' do
      (type == type2).should be_true
    end

    it 'should apply distinguish different types' do
      (type == type3).should be_false
    end

    it 'should be a total function, with false for non types' do
      (type == 12).should be_false
    end

    it 'should implement hash accordingly' do
      (type.hash == type2.hash).should be_true
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
qrb-0.3.0 spec/unit/type/set_type/test_equality.rb
qrb-0.2.0 spec/unit/type/set_type/test_equality.rb
qrb-0.1.0 spec/unit/type/set_type/test_equality.rb