spec/dbee/model/constraints/base_spec.rb in dbee-1.0.3 vs spec/dbee/model/constraints/base_spec.rb in dbee-1.1.0

- old
+ new

@@ -37,17 +37,24 @@ } end subject { described_class.new(config) } - specify '#hash produces same output as string hash of name' do - expect(subject.hash).to eq("#{config[:name]}#{config[:parent]}".hash) + specify '#hash produces same output as string hash of class name, name, and parent' do + expected_hash = "#{described_class.name}#{config[:name]}#{config[:parent]}".hash + + expect(subject.hash).to eq(expected_hash) end specify '#== and #eql? compares attributes' do object2 = described_class.new(config) expect(subject).to eq(object2) expect(subject).to eql(object2) + end + + it 'returns false unless comparing same object types' do + expect(subject).not_to eq(config) + expect(subject).not_to eq(nil) end end end