spec/factory/scalar_domain/test_hash.rb in domain-1.0.0.rc3 vs spec/factory/scalar_domain/test_hash.rb in domain-1.0.0.rc4
- old
+ new
@@ -4,11 +4,24 @@
let(:point){ Point.new(1, 2) }
subject{ point.hash }
- it 'should equal the hash of an equivalent point' do
- subject.should eq(Point.new(1,2).hash)
+ context 'on an equivalent point, same class' do
+ let(:other){ Point.new(1, 2) }
+
+ specify{
+ point.hash.should eq(other.hash)
+ }
+ end
+
+ context 'on an equivalent point, subclass' do
+ let(:sub) { Class.new(Point) }
+ let(:other){ sub.new(1, 2) }
+
+ specify{
+ point.hash.should eq(other.hash)
+ }
end
end
end