spec/dbee/model/constraints/static_spec.rb in dbee-1.0.2 vs spec/dbee/model/constraints/static_spec.rb in dbee-1.0.3
- old
+ new
@@ -13,9 +13,17 @@
context 'equality' do
let(:config) { { name: 'type', value: 'general' } }
subject { described_class.new(config) }
+ describe '#initialize' do
+ it 'requires either a name or parent' do
+ expect { described_class.new }.to raise_error(ArgumentError)
+ expect { described_class.new(name: '', parent: '') }.to raise_error(ArgumentError)
+ expect { described_class.new(name: nil, parent: nil) }.to raise_error(ArgumentError)
+ end
+ end
+
specify '#hash produces same output as concatenated string hash of name and parent' do
expect(subject.hash).to eq("#{config[:name].hash}#{config[:value]}".hash)
end
specify '#== and #eql? compare attributes' do