factory_girl 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +3 -0
- data/Changelog +9 -0
- data/GETTING_STARTED.md +47 -16
- data/Gemfile.lock +10 -9
- data/gemfiles/2.1.gemfile.lock +2 -1
- data/gemfiles/2.3.gemfile.lock +2 -1
- data/gemfiles/3.0.gemfile.lock +2 -1
- data/gemfiles/3.1.gemfile.lock +2 -1
- data/lib/factory_girl.rb +6 -3
- data/lib/factory_girl/attribute/static.rb +8 -0
- data/lib/factory_girl/attribute_list.rb +20 -12
- data/lib/factory_girl/callback.rb +30 -0
- data/lib/factory_girl/declaration.rb +19 -0
- data/lib/factory_girl/declaration/association.rb +17 -0
- data/lib/factory_girl/declaration/dynamic.rb +16 -0
- data/lib/factory_girl/declaration/implicit.rb +23 -0
- data/lib/factory_girl/declaration/static.rb +16 -0
- data/lib/factory_girl/definition_proxy.rb +6 -6
- data/lib/factory_girl/factory.rb +63 -79
- data/lib/factory_girl/proxy.rb +7 -11
- data/lib/factory_girl/proxy/attributes_for.rb +1 -0
- data/lib/factory_girl/proxy/build.rb +1 -0
- data/lib/factory_girl/proxy/stub.rb +1 -0
- data/lib/factory_girl/syntax/default.rb +4 -2
- data/lib/factory_girl/syntax/vintage.rb +1 -1
- data/lib/factory_girl/trait.rb +12 -4
- data/lib/factory_girl/version.rb +1 -1
- data/spec/acceptance/callbacks_spec.rb +7 -1
- data/spec/acceptance/modify_inherited_spec.rb +52 -0
- data/spec/acceptance/syntax/vintage_spec.rb +19 -7
- data/spec/factory_girl/attribute_list_spec.rb +18 -45
- data/spec/factory_girl/callback_spec.rb +41 -0
- data/spec/factory_girl/{attribute → declaration}/implicit_spec.rb +16 -11
- data/spec/factory_girl/definition_proxy_spec.rb +16 -12
- data/spec/factory_girl/factory_spec.rb +43 -34
- data/spec/factory_girl/proxy/create_spec.rb +7 -9
- data/spec/factory_girl/proxy_spec.rb +26 -39
- data/spec/support/shared_examples/proxy.rb +1 -1
- metadata +137 -114
- data/lib/factory_girl/attribute/callback.rb +0 -14
- data/lib/factory_girl/attribute/implicit.rb +0 -39
- data/lib/factory_girl/attribute/trait.rb +0 -22
- data/spec/factory_girl/attribute/callback_spec.rb +0 -22
@@ -38,9 +38,9 @@ describe FactoryGirl::Factory do
|
|
38
38
|
it "should return associations" do
|
39
39
|
factory = FactoryGirl::Factory.new(:post)
|
40
40
|
FactoryGirl.register_factory(FactoryGirl::Factory.new(:admin))
|
41
|
-
factory.
|
42
|
-
factory.
|
43
|
-
factory.
|
41
|
+
factory.declare_attribute(FactoryGirl::Declaration::Association.new(:author, {}))
|
42
|
+
factory.declare_attribute(FactoryGirl::Declaration::Association.new(:editor, {}))
|
43
|
+
factory.declare_attribute(FactoryGirl::Declaration::Implicit.new(:admin, factory))
|
44
44
|
factory.associations.each do |association|
|
45
45
|
association.should be_association
|
46
46
|
end
|
@@ -50,7 +50,8 @@ describe FactoryGirl::Factory do
|
|
50
50
|
it "should raise for a self referencing association" do
|
51
51
|
factory = FactoryGirl::Factory.new(:post)
|
52
52
|
lambda {
|
53
|
-
factory.
|
53
|
+
factory.declare_attribute(FactoryGirl::Declaration::Association.new(:parent, { :factory => :post }))
|
54
|
+
factory.attributes
|
54
55
|
}.should raise_error(FactoryGirl::AssociationDefinitionError)
|
55
56
|
end
|
56
57
|
|
@@ -62,21 +63,21 @@ describe FactoryGirl::Factory do
|
|
62
63
|
end
|
63
64
|
|
64
65
|
it "should return the overridden value in the generated attributes" do
|
65
|
-
|
66
|
-
@factory.
|
66
|
+
declaration = FactoryGirl::Declaration::Static.new(@name, 'The price is wrong, Bob!')
|
67
|
+
@factory.declare_attribute(declaration)
|
67
68
|
result = @factory.run(FactoryGirl::Proxy::AttributesFor, @hash)
|
68
69
|
result[@name].should == @value
|
69
70
|
end
|
70
71
|
|
71
72
|
it "should not call a lazy attribute block for an overridden attribute" do
|
72
|
-
|
73
|
-
@factory.
|
73
|
+
declaration = FactoryGirl::Declaration::Dynamic.new(@name, lambda { flunk })
|
74
|
+
@factory.declare_attribute(declaration)
|
74
75
|
result = @factory.run(FactoryGirl::Proxy::AttributesFor, @hash)
|
75
76
|
end
|
76
77
|
|
77
78
|
it "should override a symbol parameter with a string parameter" do
|
78
|
-
|
79
|
-
@factory.
|
79
|
+
declaration = FactoryGirl::Declaration::Static.new(@name, 'The price is wrong, Bob!')
|
80
|
+
@factory.declare_attribute(declaration)
|
80
81
|
@hash = { @name.to_s => @value }
|
81
82
|
result = @factory.run(FactoryGirl::Proxy::AttributesFor, @hash)
|
82
83
|
result[@name].should == @value
|
@@ -85,7 +86,7 @@ describe FactoryGirl::Factory do
|
|
85
86
|
|
86
87
|
describe "overriding an attribute with an alias" do
|
87
88
|
before do
|
88
|
-
@factory.
|
89
|
+
@factory.declare_attribute(FactoryGirl::Declaration::Static.new(:test, 'original'))
|
89
90
|
Factory.alias(/(.*)_alias/, '\1')
|
90
91
|
@result = @factory.run(FactoryGirl::Proxy::AttributesFor,
|
91
92
|
:test_alias => 'new')
|
@@ -106,52 +107,52 @@ describe FactoryGirl::Factory do
|
|
106
107
|
|
107
108
|
it "should create a new factory using the class of the parent" do
|
108
109
|
child = FactoryGirl::Factory.new(:child)
|
109
|
-
child.
|
110
|
+
child.inherit_factory(@factory)
|
110
111
|
child.build_class.should == @factory.build_class
|
111
112
|
end
|
112
113
|
|
113
114
|
it "should create a new factory while overriding the parent class" do
|
114
115
|
child = FactoryGirl::Factory.new(:child, :class => String)
|
115
|
-
child.
|
116
|
+
child.inherit_factory(@factory)
|
116
117
|
child.build_class.should == String
|
117
118
|
end
|
118
119
|
|
119
120
|
describe "given a parent with attributes" do
|
120
121
|
before do
|
121
122
|
@parent_attr = :name
|
122
|
-
@factory.
|
123
|
+
@factory.declare_attribute(FactoryGirl::Declaration::Static.new(@parent_attr, 'value'))
|
123
124
|
end
|
124
125
|
|
125
126
|
it "should create a new factory with attributes of the parent" do
|
126
127
|
child = FactoryGirl::Factory.new(:child)
|
127
|
-
child.
|
128
|
+
child.inherit_factory(@factory)
|
128
129
|
child.attributes.size.should == 1
|
129
130
|
child.attributes.first.name.should == @parent_attr
|
130
131
|
end
|
131
132
|
|
132
133
|
it "should allow a child to define additional attributes" do
|
133
134
|
child = FactoryGirl::Factory.new(:child)
|
134
|
-
child.
|
135
|
-
child.
|
135
|
+
child.declare_attribute(FactoryGirl::Declaration::Static.new(:email, 'value'))
|
136
|
+
child.inherit_factory(@factory)
|
136
137
|
child.attributes.size.should == 2
|
137
138
|
end
|
138
139
|
|
139
140
|
it "should allow to override parent attributes" do
|
140
141
|
child = FactoryGirl::Factory.new(:child)
|
141
|
-
@
|
142
|
-
child.
|
143
|
-
child.
|
142
|
+
@child_declaration = FactoryGirl::Declaration::Static.new(@parent_attr, 'overridden')
|
143
|
+
child.declare_attribute(@child_declaration)
|
144
|
+
child.inherit_factory(@factory)
|
144
145
|
child.attributes.size.should == 1
|
145
|
-
child.attributes.first.should == @
|
146
|
+
child.attributes.first.should == @child_declaration.to_attributes.first
|
146
147
|
end
|
147
148
|
|
148
149
|
it "should allow to use parent attributes in defining additional attributes" do
|
149
150
|
User.class_eval { attr_accessor :name, :email }
|
150
151
|
|
151
152
|
child = FactoryGirl::Factory.new(:child)
|
152
|
-
@
|
153
|
-
child.
|
154
|
-
child.
|
153
|
+
@child_declaration = FactoryGirl::Declaration::Dynamic.new(:email, lambda {|u| "#{u.name}@example.com"})
|
154
|
+
child.declare_attribute(@child_declaration)
|
155
|
+
child.inherit_factory(@factory)
|
155
156
|
child.attributes.size.should == 2
|
156
157
|
|
157
158
|
result = child.run(FactoryGirl::Proxy::Build, {})
|
@@ -159,11 +160,16 @@ describe FactoryGirl::Factory do
|
|
159
160
|
end
|
160
161
|
end
|
161
162
|
|
162
|
-
it "
|
163
|
+
it "inherits callbacks" do
|
163
164
|
@factory.add_callback(:after_stub) { |object| object.name = 'Stubby' }
|
164
165
|
child = FactoryGirl::Factory.new(:child)
|
165
|
-
child.
|
166
|
-
child.
|
166
|
+
child.inherit_factory(@factory)
|
167
|
+
child.callbacks.should_not be_empty
|
168
|
+
end
|
169
|
+
|
170
|
+
it "compiles when looking for attributes" do
|
171
|
+
@factory.declare_attribute(FactoryGirl::Declaration::Static.new("name", "value"))
|
172
|
+
@factory.attributes.size.should == 1
|
167
173
|
end
|
168
174
|
end
|
169
175
|
|
@@ -265,7 +271,7 @@ describe FactoryGirl::Factory do
|
|
265
271
|
subject { factory_without_strategy }
|
266
272
|
|
267
273
|
before do
|
268
|
-
subject.
|
274
|
+
subject.inherit_factory(parent)
|
269
275
|
end
|
270
276
|
|
271
277
|
it "inherits default strategy from its parent" do
|
@@ -278,7 +284,7 @@ describe FactoryGirl::Factory do
|
|
278
284
|
subject { factory_with_build_strategy }
|
279
285
|
|
280
286
|
before do
|
281
|
-
subject.
|
287
|
+
subject.inherit_factory(parent)
|
282
288
|
end
|
283
289
|
|
284
290
|
it "overrides the default strategy from parent" do
|
@@ -309,16 +315,19 @@ end
|
|
309
315
|
|
310
316
|
describe FactoryGirl::Factory, "running a factory" do
|
311
317
|
subject { FactoryGirl::Factory.new(:user) }
|
312
|
-
let(:attribute) {
|
313
|
-
let(:
|
318
|
+
let(:attribute) { FactoryGirl::Attribute::Static.new(:name, "value") }
|
319
|
+
let(:declaration) { FactoryGirl::Declaration::Static.new(:name, "value") }
|
314
320
|
let(:proxy) { stub("proxy", :result => "result", :set => nil) }
|
321
|
+
let(:attributes) { [attribute] }
|
322
|
+
let(:attribute_list) { stub('attribute-list', :declarations => [declaration], :to_a => attributes) }
|
315
323
|
|
316
324
|
before do
|
317
325
|
define_model("User", :name => :string)
|
318
|
-
FactoryGirl::
|
326
|
+
FactoryGirl::Declaration::Static.stubs(:new => declaration)
|
327
|
+
declaration.stubs(:to_attributes => attributes)
|
328
|
+
attribute.stubs(:add_to => nil)
|
319
329
|
FactoryGirl::Proxy::Build.stubs(:new => proxy)
|
320
|
-
|
321
|
-
FactoryGirl::AttributeList.stubs(:new => attribute_list)
|
330
|
+
subject.declare_attribute(declaration)
|
322
331
|
end
|
323
332
|
|
324
333
|
it "creates the right proxy using the build class when running" do
|
@@ -25,18 +25,16 @@ describe FactoryGirl::Proxy::Create do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
context "callback execution order" do
|
28
|
-
let(:after_build_callback) { stub("after_build callback", :foo => nil) }
|
29
|
-
let(:after_create_callback) { stub("after_create callback", :foo => nil) }
|
30
|
-
let(:callback_sequence) { sequence("after_* callbacks") }
|
31
|
-
|
32
28
|
it "runs after_build callbacks before after_create callbacks" do
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
29
|
+
ran = []
|
30
|
+
after_create = FactoryGirl::Callback.new(:after_create, lambda { ran << :after_create })
|
31
|
+
after_build = FactoryGirl::Callback.new(:after_build, lambda { ran << :after_build })
|
32
|
+
subject.add_callback(after_create)
|
33
|
+
subject.add_callback(after_build)
|
38
34
|
|
39
35
|
subject.result(nil)
|
36
|
+
|
37
|
+
ran.should == [:after_build, :after_create]
|
40
38
|
end
|
41
39
|
end
|
42
40
|
end
|
@@ -23,62 +23,49 @@ describe FactoryGirl::Proxy do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
describe "when adding callbacks" do
|
26
|
-
let(:block_1) { proc { "block 1" } }
|
27
|
-
let(:block_2) { proc { "block 2" } }
|
28
|
-
|
29
26
|
it "adds a callback" do
|
30
|
-
|
31
|
-
subject.
|
27
|
+
callback = FactoryGirl::Callback.new(:after_create, lambda {})
|
28
|
+
subject.add_callback(callback)
|
29
|
+
subject.callbacks[:after_create].should == [callback]
|
32
30
|
end
|
33
31
|
|
34
32
|
it "adds multiple callbacks of the same name" do
|
35
|
-
|
36
|
-
|
37
|
-
subject.
|
33
|
+
one = FactoryGirl::Callback.new(:after_create, lambda {})
|
34
|
+
two = FactoryGirl::Callback.new(:after_create, lambda {})
|
35
|
+
subject.add_callback(one)
|
36
|
+
subject.add_callback(two)
|
37
|
+
subject.callbacks[:after_create].should == [one, two]
|
38
38
|
end
|
39
39
|
|
40
40
|
it "adds multiple callbacks with different names" do
|
41
|
-
|
42
|
-
|
43
|
-
subject.
|
44
|
-
subject.
|
41
|
+
after_create = FactoryGirl::Callback.new(:after_create, lambda {})
|
42
|
+
after_build = FactoryGirl::Callback.new(:after_build, lambda {})
|
43
|
+
subject.add_callback(after_create)
|
44
|
+
subject.add_callback(after_build)
|
45
|
+
subject.callbacks[:after_create].should == [after_create]
|
46
|
+
subject.callbacks[:after_build].should == [after_build]
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
48
50
|
describe "when running callbacks" do
|
49
|
-
let(:object_1_within_callback) { stub("call_in_create", :foo => true) }
|
50
|
-
let(:object_2_within_callback) { stub("call_in_create", :foo => true) }
|
51
|
-
|
52
51
|
it "runs all callbacks with a given name" do
|
53
|
-
|
54
|
-
|
52
|
+
ran = []
|
53
|
+
one = FactoryGirl::Callback.new(:after_create, lambda { ran << :one })
|
54
|
+
two = FactoryGirl::Callback.new(:after_create, lambda { ran << :two })
|
55
|
+
subject.add_callback(one)
|
56
|
+
subject.add_callback(two)
|
55
57
|
subject.run_callbacks(:after_create)
|
56
|
-
|
57
|
-
object_2_within_callback.should have_received(:foo).once
|
58
|
+
ran.should == [:one, :two]
|
58
59
|
end
|
59
60
|
|
60
61
|
it "only runs callbacks with a given name" do
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
it "passes in the instance if the block takes an argument" do
|
69
|
-
subject.instance_variable_set("@instance", object_1_within_callback)
|
70
|
-
subject.add_callback(:after_create, proc {|spy| spy.foo })
|
71
|
-
subject.run_callbacks(:after_create)
|
72
|
-
object_1_within_callback.should have_received(:foo).once
|
73
|
-
end
|
74
|
-
|
75
|
-
it "passes in the instance and the proxy if the block takes two arguments" do
|
76
|
-
subject.instance_variable_set("@instance", object_1_within_callback)
|
77
|
-
proxy_instance = nil
|
78
|
-
subject.add_callback(:after_create, proc {|spy, proxy| spy.foo; proxy_instance = proxy })
|
62
|
+
ran = []
|
63
|
+
after_create = FactoryGirl::Callback.new(:after_create, lambda { ran << :after_create })
|
64
|
+
after_build = FactoryGirl::Callback.new(:after_build, lambda { ran << :after_build })
|
65
|
+
subject.add_callback(after_create)
|
66
|
+
subject.add_callback(after_build)
|
79
67
|
subject.run_callbacks(:after_create)
|
80
|
-
|
81
|
-
proxy_instance.should == subject
|
68
|
+
ran.should == [:after_create]
|
82
69
|
end
|
83
70
|
end
|
84
71
|
end
|
@@ -114,7 +114,7 @@ shared_examples_for "proxy with callbacks" do |callback_name|
|
|
114
114
|
let(:callback) { stub("#{callback_name} callback", :foo => nil) }
|
115
115
|
|
116
116
|
before do
|
117
|
-
subject.add_callback(callback_name, proc { callback.foo })
|
117
|
+
subject.add_callback(FactoryGirl::Callback.new(callback_name, proc { callback.foo }))
|
118
118
|
end
|
119
119
|
|
120
120
|
it "runs the #{callback_name} callback" do
|
metadata
CHANGED
@@ -1,146 +1,162 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory_girl
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
5
4
|
prerelease:
|
5
|
+
version: 2.1.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Joe Ferris
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
12
|
+
|
13
|
+
date: 2011-09-23 00:00:00 -04:00
|
13
14
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: activesupport
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
type: :runtime
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
16
28
|
name: rspec
|
17
|
-
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
18
31
|
none: false
|
19
|
-
requirements:
|
32
|
+
requirements:
|
20
33
|
- - ~>
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version:
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: "2.0"
|
23
36
|
type: :development
|
24
|
-
|
25
|
-
|
26
|
-
- !ruby/object:Gem::Dependency
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
27
39
|
name: cucumber
|
28
|
-
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
29
42
|
none: false
|
30
|
-
requirements:
|
43
|
+
requirements:
|
31
44
|
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
45
|
+
- !ruby/object:Gem::Version
|
33
46
|
version: 1.0.0
|
34
47
|
type: :development
|
35
|
-
|
36
|
-
|
37
|
-
- !ruby/object:Gem::Dependency
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
38
50
|
name: timecop
|
39
|
-
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
40
53
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
version:
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
45
58
|
type: :development
|
46
|
-
|
47
|
-
|
48
|
-
- !ruby/object:Gem::Dependency
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
49
61
|
name: rcov
|
50
|
-
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
51
64
|
none: false
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version:
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: "0"
|
56
69
|
type: :development
|
57
|
-
|
58
|
-
|
59
|
-
- !ruby/object:Gem::Dependency
|
70
|
+
version_requirements: *id005
|
71
|
+
- !ruby/object:Gem::Dependency
|
60
72
|
name: aruba
|
61
|
-
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
62
75
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version:
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: "0"
|
67
80
|
type: :development
|
68
|
-
|
69
|
-
|
70
|
-
- !ruby/object:Gem::Dependency
|
81
|
+
version_requirements: *id006
|
82
|
+
- !ruby/object:Gem::Dependency
|
71
83
|
name: mocha
|
72
|
-
|
84
|
+
prerelease: false
|
85
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
73
86
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version:
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: "0"
|
78
91
|
type: :development
|
79
|
-
|
80
|
-
|
81
|
-
- !ruby/object:Gem::Dependency
|
92
|
+
version_requirements: *id007
|
93
|
+
- !ruby/object:Gem::Dependency
|
82
94
|
name: bourne
|
83
|
-
|
95
|
+
prerelease: false
|
96
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
84
97
|
none: false
|
85
|
-
requirements:
|
86
|
-
- -
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version:
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: "0"
|
89
102
|
type: :development
|
90
|
-
|
91
|
-
|
92
|
-
- !ruby/object:Gem::Dependency
|
103
|
+
version_requirements: *id008
|
104
|
+
- !ruby/object:Gem::Dependency
|
93
105
|
name: appraisal
|
94
|
-
|
106
|
+
prerelease: false
|
107
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
95
108
|
none: false
|
96
|
-
requirements:
|
109
|
+
requirements:
|
97
110
|
- - ~>
|
98
|
-
- !ruby/object:Gem::Version
|
111
|
+
- !ruby/object:Gem::Version
|
99
112
|
version: 0.3.8
|
100
113
|
type: :development
|
101
|
-
|
102
|
-
|
103
|
-
- !ruby/object:Gem::Dependency
|
114
|
+
version_requirements: *id009
|
115
|
+
- !ruby/object:Gem::Dependency
|
104
116
|
name: sqlite3-ruby
|
105
|
-
|
117
|
+
prerelease: false
|
118
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
106
119
|
none: false
|
107
|
-
requirements:
|
108
|
-
- -
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version:
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: "0"
|
111
124
|
type: :development
|
112
|
-
|
113
|
-
|
114
|
-
- !ruby/object:Gem::Dependency
|
125
|
+
version_requirements: *id010
|
126
|
+
- !ruby/object:Gem::Dependency
|
115
127
|
name: yard
|
116
|
-
|
128
|
+
prerelease: false
|
129
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
117
130
|
none: false
|
118
|
-
requirements:
|
119
|
-
- -
|
120
|
-
- !ruby/object:Gem::Version
|
121
|
-
version:
|
131
|
+
requirements:
|
132
|
+
- - ">="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: "0"
|
122
135
|
type: :development
|
123
|
-
|
124
|
-
|
125
|
-
- !ruby/object:Gem::Dependency
|
136
|
+
version_requirements: *id011
|
137
|
+
- !ruby/object:Gem::Dependency
|
126
138
|
name: bluecloth
|
127
|
-
|
139
|
+
prerelease: false
|
140
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
128
141
|
none: false
|
129
|
-
requirements:
|
130
|
-
- -
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version:
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: "0"
|
133
146
|
type: :development
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
147
|
+
version_requirements: *id012
|
148
|
+
description: |-
|
149
|
+
factory_girl provides a framework and DSL for defining and
|
150
|
+
using factories - less error-prone, more explicit, and
|
151
|
+
all-around easier to work with than fixtures.
|
139
152
|
email: jferris@thoughtbot.com
|
140
153
|
executables: []
|
154
|
+
|
141
155
|
extensions: []
|
156
|
+
|
142
157
|
extra_rdoc_files: []
|
143
|
-
|
158
|
+
|
159
|
+
files:
|
144
160
|
- .autotest
|
145
161
|
- .gitignore
|
146
162
|
- .rspec
|
@@ -158,13 +174,16 @@ files:
|
|
158
174
|
- lib/factory_girl/aliases.rb
|
159
175
|
- lib/factory_girl/attribute.rb
|
160
176
|
- lib/factory_girl/attribute/association.rb
|
161
|
-
- lib/factory_girl/attribute/callback.rb
|
162
177
|
- lib/factory_girl/attribute/dynamic.rb
|
163
|
-
- lib/factory_girl/attribute/implicit.rb
|
164
178
|
- lib/factory_girl/attribute/sequence.rb
|
165
179
|
- lib/factory_girl/attribute/static.rb
|
166
|
-
- lib/factory_girl/attribute/trait.rb
|
167
180
|
- lib/factory_girl/attribute_list.rb
|
181
|
+
- lib/factory_girl/callback.rb
|
182
|
+
- lib/factory_girl/declaration.rb
|
183
|
+
- lib/factory_girl/declaration/association.rb
|
184
|
+
- lib/factory_girl/declaration/dynamic.rb
|
185
|
+
- lib/factory_girl/declaration/implicit.rb
|
186
|
+
- lib/factory_girl/declaration/static.rb
|
168
187
|
- lib/factory_girl/definition_proxy.rb
|
169
188
|
- lib/factory_girl/deprecated.rb
|
170
189
|
- lib/factory_girl/factory.rb
|
@@ -218,6 +237,7 @@ files:
|
|
218
237
|
- spec/acceptance/definition_spec.rb
|
219
238
|
- spec/acceptance/definition_without_block_spec.rb
|
220
239
|
- spec/acceptance/modify_factories_spec.rb
|
240
|
+
- spec/acceptance/modify_inherited_spec.rb
|
221
241
|
- spec/acceptance/overrides_spec.rb
|
222
242
|
- spec/acceptance/parent_spec.rb
|
223
243
|
- spec/acceptance/sequence_spec.rb
|
@@ -231,13 +251,13 @@ files:
|
|
231
251
|
- spec/acceptance/transient_attributes_spec.rb
|
232
252
|
- spec/factory_girl/aliases_spec.rb
|
233
253
|
- spec/factory_girl/attribute/association_spec.rb
|
234
|
-
- spec/factory_girl/attribute/callback_spec.rb
|
235
254
|
- spec/factory_girl/attribute/dynamic_spec.rb
|
236
|
-
- spec/factory_girl/attribute/implicit_spec.rb
|
237
255
|
- spec/factory_girl/attribute/sequence_spec.rb
|
238
256
|
- spec/factory_girl/attribute/static_spec.rb
|
239
257
|
- spec/factory_girl/attribute_list_spec.rb
|
240
258
|
- spec/factory_girl/attribute_spec.rb
|
259
|
+
- spec/factory_girl/callback_spec.rb
|
260
|
+
- spec/factory_girl/declaration/implicit_spec.rb
|
241
261
|
- spec/factory_girl/definition_proxy_spec.rb
|
242
262
|
- spec/factory_girl/deprecated_spec.rb
|
243
263
|
- spec/factory_girl/factory_spec.rb
|
@@ -256,30 +276,32 @@ files:
|
|
256
276
|
has_rdoc: true
|
257
277
|
homepage: https://github.com/thoughtbot/factory_girl
|
258
278
|
licenses: []
|
279
|
+
|
259
280
|
post_install_message:
|
260
281
|
rdoc_options: []
|
261
|
-
|
282
|
+
|
283
|
+
require_paths:
|
262
284
|
- lib
|
263
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
285
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
264
286
|
none: false
|
265
|
-
requirements:
|
266
|
-
- -
|
267
|
-
- !ruby/object:Gem::Version
|
268
|
-
version:
|
269
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
287
|
+
requirements:
|
288
|
+
- - ">="
|
289
|
+
- !ruby/object:Gem::Version
|
290
|
+
version: "0"
|
291
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
270
292
|
none: false
|
271
|
-
requirements:
|
272
|
-
- -
|
273
|
-
- !ruby/object:Gem::Version
|
274
|
-
version:
|
293
|
+
requirements:
|
294
|
+
- - ">="
|
295
|
+
- !ruby/object:Gem::Version
|
296
|
+
version: "0"
|
275
297
|
requirements: []
|
298
|
+
|
276
299
|
rubyforge_project:
|
277
300
|
rubygems_version: 1.6.2
|
278
301
|
signing_key:
|
279
302
|
specification_version: 3
|
280
|
-
summary: factory_girl provides a framework and DSL for defining and using model instance
|
281
|
-
|
282
|
-
test_files:
|
303
|
+
summary: factory_girl provides a framework and DSL for defining and using model instance factories.
|
304
|
+
test_files:
|
283
305
|
- Appraisals
|
284
306
|
- cucumber.yml
|
285
307
|
- features/factory_girl_steps.feature
|
@@ -309,6 +331,7 @@ test_files:
|
|
309
331
|
- spec/acceptance/definition_spec.rb
|
310
332
|
- spec/acceptance/definition_without_block_spec.rb
|
311
333
|
- spec/acceptance/modify_factories_spec.rb
|
334
|
+
- spec/acceptance/modify_inherited_spec.rb
|
312
335
|
- spec/acceptance/overrides_spec.rb
|
313
336
|
- spec/acceptance/parent_spec.rb
|
314
337
|
- spec/acceptance/sequence_spec.rb
|
@@ -322,13 +345,13 @@ test_files:
|
|
322
345
|
- spec/acceptance/transient_attributes_spec.rb
|
323
346
|
- spec/factory_girl/aliases_spec.rb
|
324
347
|
- spec/factory_girl/attribute/association_spec.rb
|
325
|
-
- spec/factory_girl/attribute/callback_spec.rb
|
326
348
|
- spec/factory_girl/attribute/dynamic_spec.rb
|
327
|
-
- spec/factory_girl/attribute/implicit_spec.rb
|
328
349
|
- spec/factory_girl/attribute/sequence_spec.rb
|
329
350
|
- spec/factory_girl/attribute/static_spec.rb
|
330
351
|
- spec/factory_girl/attribute_list_spec.rb
|
331
352
|
- spec/factory_girl/attribute_spec.rb
|
353
|
+
- spec/factory_girl/callback_spec.rb
|
354
|
+
- spec/factory_girl/declaration/implicit_spec.rb
|
332
355
|
- spec/factory_girl/definition_proxy_spec.rb
|
333
356
|
- spec/factory_girl/deprecated_spec.rb
|
334
357
|
- spec/factory_girl/factory_spec.rb
|