spec/dbee/model_spec.rb in dbee-1.0.3 vs spec/dbee/model_spec.rb in dbee-1.1.0

- old
+ new

@@ -87,18 +87,27 @@ plan = subject.ancestors(%w[members demos phone_numbers]) expect(plan).to eq(expected_plan) end + end - specify 'equality compares attributes' do - config = yaml_fixture('models.yaml')['Theaters, Members, and Movies'] + describe 'equality' do + let(:config) { yaml_fixture('models.yaml')['Theaters, Members, and Movies'] } + subject { described_class.make(config) } + + specify 'equality compares attributes' do model1 = described_class.make(config) model2 = described_class.make(config) expect(model1).to eq(model2) expect(model1).to eql(model2) + end + + it 'returns false unless comparing same object types' do + expect(subject).not_to eq(config) + expect(subject).not_to eq(nil) end end context 'README examples' do specify 'code-first and configuration-first models are equal' do