domain 1.0.0.rc3 → 1.0.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ variables:
7
7
  upper:
8
8
  Domain
9
9
  version:
10
- 1.0.0.rc3
10
+ 1.0.0.rc4
11
11
  summary: |-
12
12
  Provide tools for implementing domains (aka data types)
13
13
  description: |-
@@ -28,7 +28,7 @@ module Domain
28
28
  #
29
29
  # @api public
30
30
  def hash
31
- equality_components.map{|c| c.hash }.reduce(self.class.hash, :^)
31
+ equality_components.map{|c| c.hash }.reduce(Object.hash, :^)
32
32
  end
33
33
 
34
34
  # Compare the object with other object for equivalency
@@ -3,7 +3,7 @@ module Domain
3
3
 
4
4
  MAJOR = 1
5
5
  MINOR = 0
6
- TINY = "0.rc3"
6
+ TINY = "0.rc4"
7
7
 
8
8
  def self.to_s
9
9
  [ MAJOR, MINOR, TINY ].join('.')
@@ -6,8 +6,21 @@ module Domain
6
6
 
7
7
  subject{ point.hash }
8
8
 
9
- it 'should equal the hash of an equivalent point' do
10
- subject.should eq(Point.new(1,2).hash)
9
+ context 'on an equivalent point, same class' do
10
+ let(:other){ Point.new(1, 2) }
11
+
12
+ specify{
13
+ point.hash.should eq(other.hash)
14
+ }
15
+ end
16
+
17
+ context 'on an equivalent point, subclass' do
18
+ let(:sub) { Class.new(Point) }
19
+ let(:other){ sub.new(1, 2) }
20
+
21
+ specify{
22
+ point.hash.should eq(other.hash)
23
+ }
11
24
  end
12
25
 
13
26
  end
@@ -88,6 +88,10 @@ module Domain
88
88
  it 'should be consistent with equal' do
89
89
  subject.should eq(domain.new(1,2).hash)
90
90
  end
91
+
92
+ it 'should not be subclass dependent' do
93
+ subject.should eq(Class.new(domain).new(1,2).hash)
94
+ end
91
95
  end
92
96
 
93
97
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc3
4
+ version: 1.0.0.rc4
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-23 00:00:00.000000000 Z
12
+ date: 2012-10-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake