Sha256: c3d1a59c96de51682539ad52151be0d1a714cda87feb8a522e69870b7e17cf47
Contents?: true
Size: 1.1 KB
Versions: 1
Compression:
Stored size: 1.1 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Relation::Operation::Order::DirectionSet, '#eql?' do subject { object.eql?(other) } let(:attributes) { [ Attribute::Integer.new(:id) ] } let(:object) { described_class.coerce(attributes) } context 'with the same object' do let(:other) { object } it { should be(true) } it 'is symmetric' do should eql(other.eql?(object)) end end context 'with equivalent object' do let(:other) { object.dup } it { should be(true) } it 'is symmetric' do should eql(other.eql?(object)) end end context 'with equivalent object of a subclass' do let(:other) { Class.new(described_class).new(attributes) } it { should be(false) } it 'is symmetric' do should eql(other.eql?(object)) end end context 'with an object having different attributes' do let(:other_attributes) { [ Attribute::Integer.new(:other_id) ] } let(:other) { described_class.new(other_attributes) } it { should be(false) } it 'is symmetric' do should eql(other.eql?(object)) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
axiom-0.1.0 | spec/unit/axiom/relation/operation/order/direction_set/eql_spec.rb |