domain_model 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/lib/domain_model.rb +3 -1
- data/lib/domain_model/version.rb +1 -1
- data/spec/{model_spec.rb → domain_model_spec.rb} +11 -0
- metadata +4 -4
data/.gitignore
CHANGED
data/lib/domain_model.rb
CHANGED
data/lib/domain_model/version.rb
CHANGED
@@ -25,6 +25,17 @@ describe DomainModel do
|
|
25
25
|
|
26
26
|
expect(&required_collection).to raise_error(ArgumentError, /fields cannot be both :collection and :required/ )
|
27
27
|
end
|
28
|
+
|
29
|
+
it "inherits fields from superclasses" do
|
30
|
+
define { field :parent_field }
|
31
|
+
|
32
|
+
child_a = Class.new(Client) { field :child_a_field }
|
33
|
+
child_b = Class.new(Client) { field :child_b_field }
|
34
|
+
|
35
|
+
expect(Client.fields.map(&:name)).to eq([:parent_field])
|
36
|
+
expect(child_a.fields.map(&:name)).to eq([:parent_field, :child_a_field])
|
37
|
+
expect(child_b.fields.map(&:name)).to eq([:parent_field, :child_b_field])
|
38
|
+
end
|
28
39
|
end
|
29
40
|
|
30
41
|
describe ".validate" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: domain_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
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: 2014-03-
|
12
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -74,7 +74,7 @@ files:
|
|
74
74
|
- domain_model.gemspec
|
75
75
|
- lib/domain_model.rb
|
76
76
|
- lib/domain_model/version.rb
|
77
|
-
- spec/
|
77
|
+
- spec/domain_model_spec.rb
|
78
78
|
- spec/spec_helper.rb
|
79
79
|
homepage: ''
|
80
80
|
licenses:
|
@@ -102,5 +102,5 @@ signing_key:
|
|
102
102
|
specification_version: 3
|
103
103
|
summary: Minimal framework for definition of type-aware domain models
|
104
104
|
test_files:
|
105
|
-
- spec/
|
105
|
+
- spec/domain_model_spec.rb
|
106
106
|
- spec/spec_helper.rb
|