Sha256: 844d95f9d4f5c5264eff86afccc7e24bf9b6a3aa3851a4a24138afab91099824
Contents?: true
Size: 1.03 KB
Versions: 9
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' describe Virtus::Equalizer::Methods, '#==' do subject { object == other } let(:object) { described_class.new } let(:described_class) do Class.new do include Virtus::Equalizer::Methods def cmp?(comparator, other) !!(comparator and other) end end end context 'with the same object' do let(:other) { object } it { should be(true) } it 'is symmetric' do should eql(other == object) end end context 'with an equivalent object' do let(:other) { object.dup } it { should be(true) } it 'is symmetric' do should eql(other == object) end end context 'with an equivalent object of a subclass' do let(:other) { Class.new(described_class).new } it { should be(true) } it 'is symmetric' do should eql(other == object) end end context 'with an object of another class' do let(:other) { Class.new.new } it { should be(false) } it 'is symmetric' do should eql(other == object) end end end
Version data entries
9 entries across 9 versions & 2 rubygems