HornsAndHooves-flat_map 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HornsAndHooves-flat_map.gemspec +3 -3
- data/lib/flat_map/version.rb +1 -1
- data/spec/flat_map/errors_spec.rb +3 -3
- data/spec/flat_map/mapper/attribute_methods_spec.rb +11 -11
- data/spec/flat_map/mapper/callbacks_spec.rb +7 -7
- data/spec/flat_map/mapper/factory_spec.rb +72 -70
- data/spec/flat_map/mapper/mapping_spec.rb +17 -17
- data/spec/flat_map/mapper/mounting_spec.rb +24 -24
- data/spec/flat_map/mapper/persistence_spec.rb +34 -31
- data/spec/flat_map/mapper/skipping_spec.rb +17 -16
- data/spec/flat_map/mapper/targeting_spec.rb +32 -33
- data/spec/flat_map/mapper/traits_spec.rb +22 -22
- data/spec/flat_map/mapper/validations_spec.rb +7 -7
- data/spec/flat_map/mapping/factory_spec.rb +1 -1
- data/spec/flat_map/mapping/reader/basic_spec.rb +7 -7
- data/spec/flat_map/mapping/reader/formatted_spec.rb +9 -9
- data/spec/flat_map/mapping/reader/method_spec.rb +5 -5
- data/spec/flat_map/mapping/reader/proc_spec.rb +5 -5
- data/spec/flat_map/mapping/writer/basic_spec.rb +6 -6
- data/spec/flat_map/mapping/writer/method_spec.rb +4 -4
- data/spec/flat_map/mapping/writer/proc_spec.rb +4 -4
- data/spec/flat_map/mapping_spec.rb +24 -24
- metadata +26 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae437e1e699d72bc1e9a7edae6fe93d2a4ef2074
|
4
|
+
data.tar.gz: e3dc282d44fb77ba18df155e4386372cba68941d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adb627f3d5401014b077d9efbdcfb7bb9ad9dc516e960288a372e575f20bfab1ba3f03fa6706d6a1c26fe53328a79ff849cd6e815211452b5c7f5253ec3dbffb
|
7
|
+
data.tar.gz: 2bc1e394f9fef5e755ddc5c2fef79e6c42fb9fd3c18d4d21db7a2f992c32b82e1c44841d4fe4e29cceeade7739caa1ceb9190b8fe6e9e9d15599294c5e3d3175
|
@@ -19,11 +19,11 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
21
|
# specify any dependencies here; for example:
|
22
|
-
s.add_dependency(%q<activesupport>, ["
|
23
|
-
s.add_dependency(%q<activerecord>, ["
|
22
|
+
s.add_dependency(%q<activesupport>, ["> 4.0", "< 4.2"])
|
23
|
+
s.add_dependency(%q<activerecord>, ["> 4.0", "< 4.2"])
|
24
24
|
s.add_dependency(%q<yard>, [">= 0"])
|
25
25
|
|
26
|
-
s.add_development_dependency "rspec"
|
26
|
+
s.add_development_dependency "rspec"
|
27
27
|
s.add_development_dependency "rspec-its"
|
28
28
|
s.add_development_dependency "rake"
|
29
29
|
end
|
data/lib/flat_map/version.rb
CHANGED
@@ -11,13 +11,13 @@ describe FlatMap::Errors do
|
|
11
11
|
|
12
12
|
it "preserved errors should appear on #empty? call exactly once" do
|
13
13
|
errors.preserve :base, 'an error'
|
14
|
-
errors.
|
15
|
-
errors[:base].
|
14
|
+
expect(errors).not_to be_empty
|
15
|
+
expect(errors[:base]).to eq ['an error']
|
16
16
|
expect{ errors.empty? }.not_to change{ errors[:base].length }
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should add error to mapper with suffix" do
|
20
20
|
errors.add(:attr, 'an error')
|
21
|
-
errors[:attr_foo].
|
21
|
+
expect(errors[:attr_foo]).to eq ['an error']
|
22
22
|
end
|
23
23
|
end
|
@@ -8,8 +8,8 @@ module FlatMap
|
|
8
8
|
end
|
9
9
|
|
10
10
|
describe 'Attribute Methods' do
|
11
|
-
let(:target){ OpenStruct.new }
|
12
|
-
let(:mapper){ AttributeMethodsSpec::SpecMapper.new(target) }
|
11
|
+
let(:target) { OpenStruct.new }
|
12
|
+
let(:mapper) { AttributeMethodsSpec::SpecMapper.new(target) }
|
13
13
|
|
14
14
|
before do
|
15
15
|
target.attr_a = 'a'
|
@@ -17,27 +17,27 @@ module FlatMap
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'correctly responds to dynamic methods' do
|
20
|
-
mapper.respond_to
|
21
|
-
mapper.method(:attr_a=).
|
20
|
+
expect(mapper).to respond_to(:attr_a=)
|
21
|
+
expect(mapper.method(:attr_a=)).not_to be_nil
|
22
22
|
|
23
|
-
mapper.respond_to
|
24
|
-
mapper.method(:attr_b=).
|
23
|
+
expect(mapper).to respond_to(:attr_b=)
|
24
|
+
expect(mapper.method(:attr_b=)).not_to be_nil
|
25
25
|
end
|
26
26
|
|
27
27
|
it 'should be able to read values via method calls' do
|
28
|
-
mapper.attr_a.
|
29
|
-
mapper.attr_b.
|
28
|
+
expect(mapper.attr_a).to eq 'a'
|
29
|
+
expect(mapper.attr_b).to eq 'b'
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'should be able to write values via method calls' do
|
33
33
|
mapper.attr_a = 'A'
|
34
34
|
mapper.attr_b = 'B'
|
35
|
-
target.attr_a.
|
36
|
-
target.attr_b.
|
35
|
+
expect(target.attr_a).to eq 'A'
|
36
|
+
expect(target.attr_b).to eq 'B'
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'should still raise for unknown or private method calls' do
|
40
|
-
expect{ mapper.undefined_method
|
40
|
+
expect{ mapper.undefined_method }.to raise_error(NoMethodError)
|
41
41
|
expect{ mapper.attribute_methods }.to raise_error(NoMethodError)
|
42
42
|
end
|
43
43
|
end
|
@@ -49,27 +49,27 @@ module FlatMap
|
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'should call callbacks once' do
|
52
|
-
mapper.
|
52
|
+
expect(mapper).to receive(:set_a).once
|
53
53
|
mapper.save
|
54
54
|
end
|
55
55
|
|
56
56
|
specify 'validation callbacks' do
|
57
57
|
mapper.valid?
|
58
|
-
mapper.attr_a.
|
59
|
-
mapper.attr_b.
|
60
|
-
mapper.attr_c.
|
58
|
+
expect(mapper.attr_a).to be_nil
|
59
|
+
expect(mapper.attr_b).to eq 'before validate'
|
60
|
+
expect(mapper.attr_c).to eq 'mounted before validate'
|
61
61
|
end
|
62
62
|
|
63
63
|
specify 'save callbacks' do
|
64
64
|
mapper.save
|
65
|
-
mapper.attr_a.
|
65
|
+
expect(mapper.attr_a).to eq 'before save'
|
66
66
|
end
|
67
67
|
|
68
68
|
context 'extension trait and named traits' do
|
69
69
|
it 'should process extension first' do
|
70
|
-
mapper.extension.
|
70
|
+
expect(mapper.extension).to receive(:extension_set_b).once.and_call_original
|
71
71
|
mapper.valid?
|
72
|
-
mapper.attr_b.
|
72
|
+
expect(mapper.attr_b).to eq 'before validate'
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -2,40 +2,40 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module FlatMap
|
4
4
|
describe OpenMapper::Factory do
|
5
|
-
let(:trait_class){ Class.new(FlatMap::OpenMapper) }
|
6
|
-
let(:mapper){ OpenMapper.build }
|
5
|
+
let(:trait_class) { Class.new(FlatMap::OpenMapper) }
|
6
|
+
let(:mapper) { OpenMapper.build }
|
7
7
|
|
8
|
-
let(:mount_factory){ OpenMapper::Factory.new(:spec_mount, :traits => :used_traits) }
|
9
|
-
let(:trait_factory){ OpenMapper::Factory.new(trait_class, :trait_name => :a_trait) }
|
10
|
-
let(:open_factory){ OpenMapper::Factory.new(:some_mount, :open => true) }
|
8
|
+
let(:mount_factory) { OpenMapper::Factory.new(:spec_mount, :traits => :used_traits) }
|
9
|
+
let(:trait_factory) { OpenMapper::Factory.new(trait_class, :trait_name => :a_trait) }
|
10
|
+
let(:open_factory) { OpenMapper::Factory.new(:some_mount, :open => true) }
|
11
11
|
|
12
12
|
context 'when used for a trait' do
|
13
13
|
subject{ trait_factory }
|
14
14
|
|
15
|
-
it{
|
16
|
-
its(:name){
|
17
|
-
its(:trait_name){
|
18
|
-
its(:mapper_class){
|
15
|
+
it{ is_expected.to be_traited }
|
16
|
+
its(:name) { is_expected.to be_nil }
|
17
|
+
its(:trait_name) { is_expected.to eq :a_trait }
|
18
|
+
its(:mapper_class) { is_expected.to eq trait_class }
|
19
19
|
end
|
20
20
|
|
21
21
|
context 'when used for a mounted mapper' do
|
22
22
|
subject{ mount_factory }
|
23
23
|
|
24
|
-
it{
|
25
|
-
its(:name){
|
26
|
-
its(:trait_name){
|
27
|
-
its(:traits){
|
24
|
+
it{ is_expected.not_to be_traited }
|
25
|
+
its(:name) { is_expected.to eq :spec_mount }
|
26
|
+
its(:trait_name) { is_expected.to be_nil }
|
27
|
+
its(:traits) { is_expected.to eq [:used_traits] }
|
28
28
|
end
|
29
29
|
|
30
30
|
context 'when used for an open mapper' do
|
31
31
|
it "should have descendant of OpenMapper as mapper_class" do
|
32
|
-
open_factory.mapper_class.
|
33
|
-
open_factory.mapper_class.name.
|
32
|
+
expect(open_factory.mapper_class.ancestors).to include(OpenMapper)
|
33
|
+
expect(open_factory.mapper_class.name).to eq 'SomeMountMapper'
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should create and instance of OpenMapper with open struct as a target" do
|
37
37
|
mounted = open_factory.create(mapper)
|
38
|
-
mounted.target.
|
38
|
+
expect(mounted.target).to be_a(OpenStruct)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -48,7 +48,7 @@ module FlatMap
|
|
48
48
|
class OpenMapper::Factory::SpecMountMapper < FlatMap::OpenMapper; end
|
49
49
|
|
50
50
|
it "should be able to fetch class name from name" do
|
51
|
-
mount_factory.mapper_class.
|
51
|
+
expect(mount_factory.mapper_class.ancestors).to include(::SpecMountMapper)
|
52
52
|
end
|
53
53
|
|
54
54
|
it "should be able to fetch class from mapper_class" do
|
@@ -56,7 +56,8 @@ module FlatMap
|
|
56
56
|
:spec_mount,
|
57
57
|
:mapper_class => FlatMap::OpenMapper::Factory::SpecMountMapper
|
58
58
|
)
|
59
|
-
factory.mapper_class.
|
59
|
+
expect(factory.mapper_class.ancestors).
|
60
|
+
to include(::FlatMap::OpenMapper::Factory::SpecMountMapper)
|
60
61
|
end
|
61
62
|
|
62
63
|
it "should use options if specified" do
|
@@ -64,38 +65,39 @@ module FlatMap
|
|
64
65
|
:spec_mount,
|
65
66
|
:mapper_class_name => 'FlatMap::OpenMapper::Factory::SpecMountMapper'
|
66
67
|
)
|
67
|
-
factory.mapper_class.
|
68
|
+
expect(factory.mapper_class.ancestors).
|
69
|
+
to include(::FlatMap::OpenMapper::Factory::SpecMountMapper)
|
68
70
|
end
|
69
71
|
end
|
70
72
|
|
71
73
|
describe '#fetch_target_from' do
|
72
74
|
it "should return owner's target for traited factory" do
|
73
|
-
trait_factory.fetch_target_from(mapper).
|
75
|
+
expect(trait_factory.fetch_target_from(mapper)).to eq target
|
74
76
|
end
|
75
77
|
|
76
78
|
context 'explicit target' do
|
77
79
|
it "should use explicitly specified if applicable" do
|
78
80
|
factory = OpenMapper::Factory.new(:spec_mount, :target => other_target)
|
79
|
-
factory.fetch_target_from(mapper).
|
81
|
+
expect(factory.fetch_target_from(mapper)).to eq other_target
|
80
82
|
end
|
81
83
|
|
82
84
|
it "should call Proc and pass owner target to it if Proc is specified as :target" do
|
83
85
|
factory = OpenMapper::Factory.new(:spec_mount, :target => lambda{ |obj| obj.foo })
|
84
|
-
target.
|
85
|
-
factory.fetch_target_from(mapper).
|
86
|
+
expect(target).to receive(:foo).and_return(other_target)
|
87
|
+
expect(factory.fetch_target_from(mapper)).to eq other_target
|
86
88
|
end
|
87
89
|
|
88
90
|
it "should call a method if Symbol is used" do
|
89
91
|
factory = OpenMapper::Factory.new(:spec_mount, :target => :foo)
|
90
|
-
mapper.
|
91
|
-
factory.fetch_target_from(mapper).
|
92
|
+
expect(mapper).to receive(:foo).and_return(other_target)
|
93
|
+
expect(factory.fetch_target_from(mapper)).to eq other_target
|
92
94
|
end
|
93
95
|
end
|
94
96
|
|
95
97
|
context 'target from association' do
|
96
98
|
before do
|
97
|
-
target.
|
98
|
-
target.
|
99
|
+
allow(target).to receive(:is_a?).and_call_original
|
100
|
+
expect(target).to receive(:is_a?).with(ActiveRecord::Base).and_return(true)
|
99
101
|
end
|
100
102
|
|
101
103
|
let(:has_one_current_reflection) {
|
@@ -113,68 +115,68 @@ module FlatMap
|
|
113
115
|
|
114
116
|
it "should refer to effective name for has_one_current association" do
|
115
117
|
# Note: has_one_current is not part of Rails
|
116
|
-
mount_factory.
|
118
|
+
expect(mount_factory).to receive(:reflection_from_target).
|
117
119
|
with(target).
|
118
120
|
and_return(has_one_current_reflection)
|
119
|
-
target.
|
120
|
-
mount_factory.fetch_target_from(mapper).
|
121
|
+
expect(target).to receive(:effective_spec_mount).and_return(other_target)
|
122
|
+
expect(mount_factory.fetch_target_from(mapper)).to eq other_target
|
121
123
|
end
|
122
124
|
|
123
125
|
it "should refer to existing association object if possible, " \
|
124
126
|
"and build it if it is absent for :has_one" do
|
125
|
-
mount_factory.
|
127
|
+
expect(mount_factory).to receive(:reflection_from_target).
|
126
128
|
with(target).
|
127
129
|
and_return(has_one_reflection)
|
128
|
-
target.
|
129
|
-
target.
|
130
|
-
mount_factory.fetch_target_from(mapper).
|
130
|
+
expect(target).to receive(:spec_mount).and_return(nil)
|
131
|
+
expect(target).to receive(:build_spec_mount).and_return(other_target)
|
132
|
+
expect(mount_factory.fetch_target_from(mapper)).to eq other_target
|
131
133
|
end
|
132
134
|
|
133
135
|
it "should refer to existing association object if possible, " \
|
134
136
|
"and build it if it is absent for :belongs_to" do
|
135
|
-
mount_factory.
|
137
|
+
expect(mount_factory).to receive(:reflection_from_target).
|
136
138
|
with(target).
|
137
139
|
and_return(belongs_to_reflection)
|
138
|
-
target.
|
139
|
-
target.
|
140
|
-
mount_factory.fetch_target_from(mapper).
|
140
|
+
expect(target).to receive(:spec_mount).and_return(nil)
|
141
|
+
expect(target).to receive(:build_spec_mount).and_return(other_target)
|
142
|
+
expect(mount_factory.fetch_target_from(mapper)).to eq other_target
|
141
143
|
end
|
142
144
|
|
143
145
|
it "should always build a new record for :has_many association" do
|
144
|
-
mount_factory.
|
146
|
+
expect(mount_factory).to receive(:reflection_from_target).
|
145
147
|
with(target).
|
146
148
|
and_return(has_many_reflection)
|
147
|
-
target.
|
148
|
-
target.
|
149
|
-
mount_factory.fetch_target_from(mapper).
|
149
|
+
expect(target).to receive(:association).with(:spec_mounts)
|
150
|
+
allow(target).to receive_message_chain(:association, :build).and_return(other_target)
|
151
|
+
expect(mount_factory.fetch_target_from(mapper)).to eq other_target
|
150
152
|
end
|
151
153
|
|
152
154
|
describe 'reflection_from_target' do
|
153
|
-
before{ target.
|
155
|
+
before{ allow(target).to receive(:is_a?).with(ActiveRecord::Base).and_return(true) }
|
154
156
|
|
155
157
|
it 'should first refer to singular association' do
|
156
|
-
target.
|
158
|
+
allow(target).to receive_message_chain(:class, :reflect_on_association).
|
157
159
|
with(:spec_mount).
|
158
160
|
and_return(has_one_reflection)
|
159
|
-
mount_factory.reflection_from_target(target).
|
161
|
+
expect(mount_factory.reflection_from_target(target)).to eq has_one_reflection
|
160
162
|
end
|
161
163
|
|
162
164
|
it 'should use collection association if singular does not exist' do
|
163
|
-
target.
|
165
|
+
allow(target).to receive_message_chain(:class, :reflect_on_association).
|
164
166
|
with(:spec_mount).
|
165
167
|
and_return(nil)
|
166
|
-
target.
|
168
|
+
allow(target).to receive_message_chain(:class, :reflect_on_association).
|
167
169
|
with(:spec_mounts).
|
168
170
|
and_return(has_many_reflection)
|
169
|
-
mount_factory.reflection_from_target(target).
|
171
|
+
expect(mount_factory.reflection_from_target(target)).to eq has_many_reflection
|
170
172
|
end
|
171
173
|
end
|
172
174
|
end
|
173
175
|
|
174
176
|
context 'target from name' do
|
175
177
|
it 'should simply send method to owner target' do
|
176
|
-
target.
|
177
|
-
mount_factory.fetch_target_from(mapper).
|
178
|
+
expect(target).to receive(:spec_mount).and_return(other_target)
|
179
|
+
expect(mount_factory.fetch_target_from(mapper)).to eq other_target
|
178
180
|
end
|
179
181
|
end
|
180
182
|
end
|
@@ -182,7 +184,7 @@ module FlatMap
|
|
182
184
|
describe '#create' do
|
183
185
|
specify 'traited factory should create an owned mapper' do
|
184
186
|
new_one = trait_factory.create(mapper)
|
185
|
-
new_one.owner.
|
187
|
+
expect(new_one.owner).to eq mapper
|
186
188
|
end
|
187
189
|
|
188
190
|
context 'mounted mapper' do
|
@@ -190,12 +192,12 @@ module FlatMap
|
|
190
192
|
let(:factory){ mount_factory }
|
191
193
|
|
192
194
|
before do
|
193
|
-
factory.
|
194
|
-
factory.
|
195
|
+
allow(factory).to receive(:mapper_class ).and_return(mount_class)
|
196
|
+
allow(factory).to receive(:fetch_target_from).and_return(other_target)
|
195
197
|
end
|
196
198
|
|
197
199
|
it 'should combine traits' do
|
198
|
-
mount_class.
|
200
|
+
expect(mount_class).to receive(:new).
|
199
201
|
with(other_target, :used_traits, :another_trait).
|
200
202
|
and_call_original
|
201
203
|
factory.create(mapper, :another_trait)
|
@@ -203,10 +205,10 @@ module FlatMap
|
|
203
205
|
|
204
206
|
it 'should properly set properties' do
|
205
207
|
new_one = factory.create(mapper)
|
206
|
-
new_one.host .
|
207
|
-
new_one.name .
|
208
|
-
new_one.save_order.
|
209
|
-
new_one.suffix.
|
208
|
+
expect(new_one.host ).to eq mapper
|
209
|
+
expect(new_one.name ).to eq :spec_mount
|
210
|
+
expect(new_one.save_order).to eq :after
|
211
|
+
expect(new_one.suffix ).to be_nil
|
210
212
|
end
|
211
213
|
|
212
214
|
context 'when suffix is defined' do
|
@@ -214,8 +216,8 @@ module FlatMap
|
|
214
216
|
|
215
217
|
it "should adjust properties with suffix" do
|
216
218
|
new_one = factory.create(mapper)
|
217
|
-
new_one.name .
|
218
|
-
new_one.suffix.
|
219
|
+
expect(new_one.name ).to eq :spec_mount_foo
|
220
|
+
expect(new_one.suffix).to eq :foo
|
219
221
|
end
|
220
222
|
end
|
221
223
|
|
@@ -224,7 +226,7 @@ module FlatMap
|
|
224
226
|
let(:factory){ OpenMapper::Factory.new(:spec_mount, &extension) }
|
225
227
|
|
226
228
|
it "should pass it to mapper initialization" do
|
227
|
-
mount_class.
|
229
|
+
expect(mount_class).to receive(:new).
|
228
230
|
with(other_target, &extension).
|
229
231
|
and_call_original
|
230
232
|
new_one = factory.create(mapper)
|
@@ -233,20 +235,20 @@ module FlatMap
|
|
233
235
|
|
234
236
|
describe 'save order' do
|
235
237
|
before do
|
236
|
-
mapper.
|
237
|
-
mapper.
|
238
|
+
allow(mapper).to receive(:is_a?).and_call_original
|
239
|
+
allow(mapper).to receive(:is_a?).with(ModelMapper).and_return(true)
|
238
240
|
end
|
239
241
|
|
240
242
|
it 'should be :before for belongs_to association' do
|
241
|
-
factory.
|
243
|
+
expect(factory).to receive(:reflection_from_target).
|
242
244
|
and_return(double('reflection', :macro => :belongs_to))
|
243
|
-
factory.fetch_save_order(mapper).
|
245
|
+
expect(factory.fetch_save_order(mapper)).to eq :before
|
244
246
|
end
|
245
247
|
|
246
248
|
it 'should be :after for other cases' do
|
247
|
-
factory.
|
249
|
+
expect(factory).to receive(:reflection_from_target).
|
248
250
|
and_return(double('reflection', :macro => :has_one))
|
249
|
-
factory.fetch_save_order(mapper).
|
251
|
+
expect(factory.fetch_save_order(mapper)).to eq :after
|
250
252
|
end
|
251
253
|
|
252
254
|
context 'when explicitly set' do
|
@@ -254,7 +256,7 @@ module FlatMap
|
|
254
256
|
|
255
257
|
it 'should fetch from options, if possible' do
|
256
258
|
new_one = factory.create(mapper)
|
257
|
-
new_one.save_order.
|
259
|
+
expect(new_one.save_order).to eq :before
|
258
260
|
end
|
259
261
|
end
|
260
262
|
end
|
@@ -273,11 +275,11 @@ module FlatMap
|
|
273
275
|
let(:factory_for_b){ mapper_class.mountings.first.mapper_class.mountings.first }
|
274
276
|
|
275
277
|
it "should be required for nested trait" do
|
276
|
-
factory_for_b.required_for_any_trait?([:trait_c]).
|
278
|
+
expect(factory_for_b.required_for_any_trait?([:trait_c])).to be true
|
277
279
|
end
|
278
280
|
|
279
281
|
it "should not be required for top trait" do
|
280
|
-
factory_for_b.required_for_any_trait?([:trait_a]).
|
282
|
+
expect(factory_for_b.required_for_any_trait?([:trait_a])).to be false
|
281
283
|
end
|
282
284
|
end
|
283
285
|
end
|