Sha256: 7215ac7279ebd28907935c0500ff1eb4a17d363b9c676fc93ba6a954db475402
Contents?: true
Size: 886 Bytes
Versions: 9
Compression:
Stored size: 886 Bytes
Contents
require 'spec_helper' describe Virtus::Equalizer::Methods, '#eql?' do subject { object.eql?(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.eql?(object)) end end context 'with an equivalent object' do let(:other) { object.dup } it { should be(true) } it 'is symmetric' do should eql(other.eql?(object)) end end context 'with an equivalent object of a subclass' do let(:other) { Class.new(described_class).new } it { should be(false) } it 'is symmetric' do should eql(other.eql?(object)) end end end
Version data entries
9 entries across 9 versions & 2 rubygems