Sha256: c992b5991ee475260508c5afaee496ec8b048f895a0191786ded308b8b298fa1
Contents?: true
Size: 1.92 KB
Versions: 1
Compression:
Stored size: 1.92 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Relation::Header, '#==' do subject { object == other } let(:attributes) { [ [ :id, Integer ] ] } let(:object) { described_class.new(attributes) } context 'with the same object' do let(:other) { object } it { should be(true) } it 'is symmetric' do should == (other == object) end end context 'with an equivalent object' do let(:other) { object.dup } it { should be(true) } it 'is symmetric' do should == (other == object) end end context 'with an equivalent object of subclasses' do let(:other) { Class.new(described_class).new(attributes) } it { should be(true) } it 'is symmetric' do should == (other == object) end end context 'with an object having different attributes' do let(:other_attributes) { [ [ :name, String ] ] } let(:other) { described_class.new(other_attributes) } it { should be(false) } it 'is symmetric' do should == (other == object) end end context 'with an object having equivalent attributes in a different order' do let(:attribute1) { [ :id, Integer ] } let(:attribute2) { [ :name, String ] } let(:object) { described_class.new([ attribute1, attribute2 ]) } let(:other) { described_class.new([ attribute2, attribute1 ]) } it { should be(true) } it 'is symmetric' do should == (other == object) end end context 'with an equivalent object responding to #to_ary' do let(:other) { attributes } it { should be(true) } it 'is symmetric' do should == (other == object) end end context 'with a different object responding to #to_ary' do let(:other) { [ [ :name, String ] ] } it { should be(false) } it 'is symmetric' do should == (other == object) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
veritas-0.0.4 | spec/unit/veritas/relation/header/equal_value_spec.rb |