factory_girl 2.3.2 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.travis.yml +5 -3
  2. data/Appraisals +4 -0
  3. data/CONTRIBUTION_GUIDELINES.md +1 -1
  4. data/Changelog +13 -0
  5. data/GETTING_STARTED.md +362 -286
  6. data/Gemfile.lock +1 -1
  7. data/README.md +8 -8
  8. data/features/factory_girl_steps.feature +4 -0
  9. data/features/support/factories.rb +19 -0
  10. data/gemfiles/2.1.gemfile.lock +1 -1
  11. data/gemfiles/2.3.gemfile.lock +1 -1
  12. data/gemfiles/3.0.gemfile.lock +1 -1
  13. data/gemfiles/3.1.gemfile.lock +1 -1
  14. data/gemfiles/3.2.gemfile +7 -0
  15. data/gemfiles/3.2.gemfile.lock +90 -0
  16. data/lib/factory_girl.rb +4 -0
  17. data/lib/factory_girl/attribute.rb +1 -9
  18. data/lib/factory_girl/attribute/association.rb +2 -2
  19. data/lib/factory_girl/attribute/dynamic.rb +2 -2
  20. data/lib/factory_girl/attribute/sequence.rb +1 -1
  21. data/lib/factory_girl/attribute/static.rb +1 -1
  22. data/lib/factory_girl/attribute_assigner.rb +73 -0
  23. data/lib/factory_girl/attribute_list.rb +6 -15
  24. data/lib/factory_girl/callback.rb +2 -2
  25. data/lib/factory_girl/evaluator.rb +57 -0
  26. data/lib/factory_girl/evaluator_class_definer.rb +34 -0
  27. data/lib/factory_girl/factory.rb +31 -80
  28. data/lib/factory_girl/null_factory.rb +2 -1
  29. data/lib/factory_girl/null_object.rb +19 -0
  30. data/lib/factory_girl/proxy.rb +6 -87
  31. data/lib/factory_girl/proxy/attributes_for.rb +2 -7
  32. data/lib/factory_girl/proxy/build.rb +4 -3
  33. data/lib/factory_girl/proxy/create.rb +6 -7
  34. data/lib/factory_girl/proxy/stub.rb +19 -18
  35. data/lib/factory_girl/step_definitions.rb +4 -3
  36. data/lib/factory_girl/version.rb +1 -1
  37. data/spec/acceptance/aliases_spec.rb +19 -0
  38. data/spec/acceptance/attributes_for_spec.rb +10 -1
  39. data/spec/acceptance/attributes_from_instance_spec.rb +53 -0
  40. data/spec/acceptance/build_spec.rb +8 -0
  41. data/spec/acceptance/build_stubbed_spec.rb +9 -0
  42. data/spec/acceptance/create_spec.rb +8 -0
  43. data/spec/factory_girl/attribute/association_spec.rb +5 -4
  44. data/spec/factory_girl/attribute/dynamic_spec.rb +9 -10
  45. data/spec/factory_girl/attribute/sequence_spec.rb +1 -2
  46. data/spec/factory_girl/attribute/static_spec.rb +1 -2
  47. data/spec/factory_girl/attribute_list_spec.rb +14 -4
  48. data/spec/factory_girl/evaluator_class_definer_spec.rb +54 -0
  49. data/spec/factory_girl/factory_spec.rb +23 -16
  50. data/spec/factory_girl/null_factory_spec.rb +2 -1
  51. data/spec/factory_girl/null_object_spec.rb +8 -0
  52. data/spec/factory_girl/proxy/attributes_for_spec.rb +8 -24
  53. data/spec/factory_girl/proxy/build_spec.rb +1 -7
  54. data/spec/factory_girl/proxy/create_spec.rb +2 -27
  55. data/spec/factory_girl/proxy/stub_spec.rb +14 -13
  56. data/spec/factory_girl/proxy_spec.rb +1 -33
  57. data/spec/support/shared_examples/proxy.rb +22 -45
  58. metadata +133 -177
@@ -6,7 +6,8 @@ describe FactoryGirl::NullFactory do
6
6
  it { should delegate(:attributes).to(:definition) }
7
7
 
8
8
  its(:compile) { should be_nil }
9
- its(:default_strategy) { should be_nil }
10
9
  its(:class_name) { should be_nil }
10
+ its(:default_strategy) { should == :create }
11
11
  its(:attributes) { should be_an_instance_of(FactoryGirl::AttributeList) }
12
+ its(:evaluator_class) { should == FactoryGirl::Evaluator }
12
13
  end
@@ -0,0 +1,8 @@
1
+ require "spec_helper"
2
+
3
+ describe FactoryGirl::NullObject do
4
+ its(:id) { should be_nil }
5
+ its(:age) { should be_nil }
6
+ its(:name) { should be_nil }
7
+ its(:admin?) { should be_nil }
8
+ end
@@ -1,34 +1,18 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe FactoryGirl::Proxy::AttributesFor do
4
- let(:proxy_class) { stub("proxy_class") }
5
-
6
- subject { FactoryGirl::Proxy::AttributesFor.new(proxy_class) }
4
+ let(:result) { { :name => "John Doe", :gender => "Male", :admin => false } }
5
+ let(:attribute_assigner) { stub("attribute assigner", :hash => result) }
7
6
 
8
7
  it_should_behave_like "proxy without association support"
9
8
 
10
- it "returns a hash when asked for the result" do
11
- subject.result(nil).should be_kind_of(Hash)
9
+ it "returns the hash from the attribute assigner" do
10
+ subject.result(attribute_assigner, lambda {|item| item }).should == result
12
11
  end
13
12
 
14
- it "does not instantiate the proxy class" do
15
- proxy_class.stubs(:new)
16
- subject.result(nil)
17
- proxy_class.should have_received(:new).never
18
- end
19
-
20
- describe "after setting an attribute" do
21
- let(:attribute) { stub("attribute", :name => :attribute) }
22
-
23
- before { subject.set(attribute, lambda { "value" }) }
24
-
25
- it "sets that value in the resulting hash" do
26
- subject.result(nil)[:attribute].should == "value"
27
- end
28
-
29
- it "returns that value when asked for that attribute" do
30
- subject.get(:attribute).should == "value"
31
- end
13
+ it "does not run the to_create block" do
14
+ expect do
15
+ subject.result(attribute_assigner, lambda {|item| raise "failed" })
16
+ end.to_not raise_error
32
17
  end
33
18
  end
34
-
@@ -1,13 +1,7 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe FactoryGirl::Proxy::Build do
4
- let(:instance) { stub("built-instance") }
5
- let(:proxy_class) { stub("class", :new => instance) }
6
-
7
- subject { FactoryGirl::Proxy::Build.new(proxy_class) }
8
-
9
4
  it_should_behave_like "proxy with association support", FactoryGirl::Proxy::Create
10
- it_should_behave_like "proxy with standard getters and setters", :attribute_name, "attribute value!"
11
5
  it_should_behave_like "proxy with callbacks", :after_build
12
6
  it_should_behave_like "proxy with :method => :build", FactoryGirl::Proxy::Build
13
7
  end
@@ -1,38 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe FactoryGirl::Proxy::Create do
4
- let(:instance) { stub("created-instance", :save! => true) }
5
- let(:proxy_class) { stub("class", :new => instance) }
6
-
7
- subject { FactoryGirl::Proxy::Create.new(proxy_class) }
8
-
9
4
  it_should_behave_like "proxy with association support", FactoryGirl::Proxy::Create
10
- it_should_behave_like "proxy with standard getters and setters", :attribute_name, "attribute value!"
11
- it_should_behave_like "proxy with callbacks", :after_build
12
- it_should_behave_like "proxy with callbacks", :after_create
5
+ it_should_behave_like "proxy with callbacks", :after_build, :after_create
13
6
 
14
7
  it "runs a custom create block" do
15
8
  block_run = false
16
9
  block = lambda {|instance| block_run = true }
17
- subject.result(block)
18
- instance.should have_received(:save!).never
10
+ subject.result(stub("assigner", :object => stub("result instance")), block)
19
11
  block_run.should be_true
20
12
  end
21
13
  end
22
-
23
- describe FactoryGirl::Proxy::Create, "when running callbacks" do
24
- let(:instance) { stub("created-instance", :save! => true) }
25
- let(:proxy_class) { stub("class", :new => instance) }
26
- let!(:callback_result) { [] }
27
-
28
- let(:after_create_one) { FactoryGirl::Callback.new(:after_create, lambda { callback_result << :after_create_one }) }
29
- let(:after_create_two) { FactoryGirl::Callback.new(:after_create, lambda { callback_result << :after_create_two }) }
30
- let(:after_build_one) { FactoryGirl::Callback.new(:after_build, lambda { callback_result << :after_build_one }) }
31
-
32
- subject { FactoryGirl::Proxy::Create.new(proxy_class, [after_create_one, after_create_two, after_build_one]) }
33
-
34
- it "runs callbacks in the correct order" do
35
- subject.result(lambda {|instance| instance })
36
- callback_result.should == [:after_build_one, :after_create_one, :after_create_two]
37
- end
38
- end
@@ -1,37 +1,38 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe FactoryGirl::Proxy::Stub do
4
- let(:instance) { stub("instance", :id= => nil, :id => 42) }
5
- let(:proxy_class) { stub("class", :new => instance) }
6
-
7
- subject { FactoryGirl::Proxy::Stub.new(proxy_class) }
8
-
9
4
  it_should_behave_like "proxy with association support", FactoryGirl::Proxy::Stub
10
- it_should_behave_like "proxy with standard getters and setters", :attribute_name, "attribute value!"
11
5
  it_should_behave_like "proxy with callbacks", :after_stub
12
- it_should_behave_like "proxy with :method => :build",
13
- FactoryGirl::Proxy::Stub
6
+ it_should_behave_like "proxy with :method => :build", FactoryGirl::Proxy::Stub
14
7
 
15
8
  context "asking for a result" do
16
9
  before { Timecop.freeze(Time.now) }
17
10
  after { Timecop.return }
11
+ let(:result_instance) do
12
+ define_class("ResultInstance") do
13
+ attr_accessor :id
14
+ end.new
15
+ end
16
+
17
+ let(:assigner) { stub("attribute assigner", :object => result_instance) }
18
+ let(:to_create) { lambda {|instance| instance } }
18
19
 
19
- it { subject.result(nil).should_not be_new_record }
20
- it { subject.result(nil).should be_persisted }
20
+ it { subject.result(assigner, to_create).should_not be_new_record }
21
+ it { subject.result(assigner, to_create).should be_persisted }
21
22
 
22
23
  it "assigns created_at" do
23
- created_at = subject.result(nil).created_at
24
+ created_at = subject.result(assigner, to_create).created_at
24
25
  created_at.should == Time.now
25
26
 
26
27
  Timecop.travel(150000)
27
28
 
28
- subject.result(nil).created_at.should == created_at
29
+ subject.result(assigner, to_create).created_at.should == created_at
29
30
  end
30
31
 
31
32
  [:save, :destroy, :connection, :reload, :update_attribute].each do |database_method|
32
33
  it "raises when attempting to connect to the database by calling #{database_method}" do
33
34
  expect do
34
- subject.result(nil).send(database_method)
35
+ subject.result(assigner, to_create).send(database_method)
35
36
  end.to raise_error(RuntimeError, "stubbed models are not allowed to access the database")
36
37
  end
37
38
  end
@@ -1,42 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe FactoryGirl::Proxy do
4
- subject { FactoryGirl::Proxy.new(Class.new) }
5
-
6
4
  it_should_behave_like "proxy without association support"
7
5
 
8
- it "doesn't raise when assigning a value to an attribute" do
9
- name_attribute = FactoryGirl::Attribute::Static.new(:name, "great", false)
10
- expect { subject.set(name_attribute, lambda { "a name" }) }.to_not raise_error
11
- end
12
-
13
- it "calls get for a missing method" do
14
- subject.stubs(:get).with(:name).returns("it's a name")
15
- subject.name.should == "it's a name"
16
- end
17
-
18
6
  it "raises an error when asking for the result" do
19
- expect { subject.result(nil) }.to raise_error(NotImplementedError)
20
- end
21
- end
22
-
23
- describe FactoryGirl::Proxy, "when running callbacks" do
24
- let!(:callback_result) { [] }
25
-
26
- let(:after_create_one) { FactoryGirl::Callback.new(:after_create, lambda { callback_result << :after_create_one }) }
27
- let(:after_create_two) { FactoryGirl::Callback.new(:after_create, lambda { callback_result << :after_create_two }) }
28
- let(:after_build_one) { FactoryGirl::Callback.new(:after_build, lambda { callback_result << :after_build_one }) }
29
-
30
- subject { FactoryGirl::Proxy.new(Class.new, [after_create_one, after_create_two, after_build_one]) }
31
-
32
- it "runs callbacks in the correct order" do
33
- subject.run_callbacks(:after_create)
34
- callback_result.should == [:after_create_one, :after_create_two]
35
- end
36
-
37
- it "runs the correct callbacks based on name" do
38
- subject.run_callbacks(:after_build)
39
- callback_result.should == [:after_build_one]
7
+ expect { subject.result(stub("assigner"), lambda {|instance| instance }) }.to raise_error(NotImplementedError)
40
8
  end
41
9
  end
42
10
 
@@ -1,12 +1,6 @@
1
1
  shared_examples_for "proxy without association support" do
2
2
  let(:attribute) { FactoryGirl::Attribute::Association.new(:user, :user, {}) }
3
3
 
4
- it "does not call FactoryGirl.create when building an association" do
5
- FactoryGirl.stubs(:create)
6
- subject.set(attribute, lambda { "awesome" })
7
- FactoryGirl.should have_received(:create).never
8
- end
9
-
10
4
  it "returns nil when accessing an association" do
11
5
  subject.association(:user, {}).should be_nil
12
6
  end
@@ -60,54 +54,37 @@ shared_examples_for "proxy with :method => :build" do |factory_girl_proxy_class|
60
54
  end
61
55
  end
62
56
 
63
- shared_examples_for "proxy with standard getters and setters" do |attribute, value|
64
- let(:attribute_instance) { stub("attribute #{attribute}", :name => attribute) }
65
-
66
- before do
67
- instance.stubs(:"#{attribute}=" => value, :"#{attribute}" => value)
68
- end
69
-
70
- describe "when setting an attribute" do
71
- before do
72
- subject.set(attribute_instance, lambda { value })
73
- subject.result(lambda {|instance| instance })
74
- end
75
-
76
- its(attribute) { should == value }
77
- it { instance.should have_received(:"#{attribute}=").with(value) }
78
- end
57
+ shared_examples_for "proxy with callbacks" do |*callback_names|
58
+ let(:callback_observer) do
59
+ define_class("CallbackObserver") do
60
+ attr_reader :callbacks_called
79
61
 
80
- describe "when setting an ignored attribute" do
81
- before do
82
- subject.set_ignored(attribute_instance, lambda { value })
83
- subject.result(lambda {|instance| instance })
84
- end
62
+ def initialize
63
+ @callbacks_called = []
64
+ end
85
65
 
86
- it { instance.should have_received(:"#{attribute}=").with(value).never }
66
+ def update(callback_name, assigner)
67
+ @callbacks_called << [callback_name, assigner]
68
+ end
69
+ end.new
87
70
  end
88
71
 
89
- describe "when getting an attribute" do
90
- before do
91
- subject.set(attribute_instance, lambda { value })
92
- subject.result(lambda {|instance| instance })
93
- end
94
-
95
- it { subject.get(attribute).should == value }
72
+ let(:result_instance) do
73
+ define_class("ResultInstance") do
74
+ attr_accessor :id
75
+ end.new
96
76
  end
97
- end
98
77
 
99
- shared_examples_for "proxy with callbacks" do |callback_name|
100
- let(:callback_instance) { stub("#{callback_name} callback", :foo => nil) }
101
- let(:callback) { FactoryGirl::Callback.new(callback_name, proc { callback_instance.foo }) }
78
+ let(:assigner) { stub("attribute assigner", :object => result_instance) }
102
79
 
103
- subject { described_class.new(proxy_class, [callback]) }
80
+ before { subject.add_observer(callback_observer) }
104
81
 
105
- it "runs the #{callback_name} callback" do
106
- subject.result(lambda {|instance| instance })
107
- callback_instance.should have_received(:foo).once
82
+ it "runs the callbacks #{callback_names} with the assigner's object" do
83
+ subject.result(assigner, lambda {|instance| instance })
84
+ callback_observer.callbacks_called.should == callback_names.map {|name| [name, assigner.object] }
108
85
  end
109
86
 
110
- it "returns the proxy instance" do
111
- subject.result(lambda {|instance| instance }).should == instance
87
+ it "returns the object from the assigner" do
88
+ subject.result(assigner, lambda {|instance| instance }).should == assigner.object
112
89
  end
113
90
  end
metadata CHANGED
@@ -1,208 +1,156 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: factory_girl
3
- version: !ruby/object:Gem::Version
4
- hash: 7
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.4.0
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 3
9
- - 2
10
- version: 2.3.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Joe Ferris
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-11-26 00:00:00 -05:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2012-01-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: activesupport
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70203557477340 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: rspec
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70203557477340
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ requirement: &70203557470340 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
29
+ requirements:
41
30
  - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 2
46
- - 0
47
- version: "2.0"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
48
33
  type: :development
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: cucumber
52
34
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70203557470340
36
+ - !ruby/object:Gem::Dependency
37
+ name: cucumber
38
+ requirement: &70203557469400 !ruby/object:Gem::Requirement
54
39
  none: false
55
- requirements:
40
+ requirements:
56
41
  - - ~>
57
- - !ruby/object:Gem::Version
58
- hash: 23
59
- segments:
60
- - 1
61
- - 0
62
- - 0
42
+ - !ruby/object:Gem::Version
63
43
  version: 1.0.0
64
44
  type: :development
65
- version_requirements: *id003
66
- - !ruby/object:Gem::Dependency
67
- name: timecop
68
45
  prerelease: false
69
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70203557469400
47
+ - !ruby/object:Gem::Dependency
48
+ name: timecop
49
+ requirement: &70203557468720 !ruby/object:Gem::Requirement
70
50
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 3
75
- segments:
76
- - 0
77
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
78
55
  type: :development
79
- version_requirements: *id004
80
- - !ruby/object:Gem::Dependency
81
- name: rcov
82
56
  prerelease: false
83
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70203557468720
58
+ - !ruby/object:Gem::Dependency
59
+ name: rcov
60
+ requirement: &70203557467720 !ruby/object:Gem::Requirement
84
61
  none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- hash: 3
89
- segments:
90
- - 0
91
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
92
66
  type: :development
93
- version_requirements: *id005
94
- - !ruby/object:Gem::Dependency
95
- name: aruba
96
67
  prerelease: false
97
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *70203557467720
69
+ - !ruby/object:Gem::Dependency
70
+ name: aruba
71
+ requirement: &70203557466180 !ruby/object:Gem::Requirement
98
72
  none: false
99
- requirements:
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- hash: 3
103
- segments:
104
- - 0
105
- version: "0"
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
106
77
  type: :development
107
- version_requirements: *id006
108
- - !ruby/object:Gem::Dependency
109
- name: mocha
110
78
  prerelease: false
111
- requirement: &id007 !ruby/object:Gem::Requirement
79
+ version_requirements: *70203557466180
80
+ - !ruby/object:Gem::Dependency
81
+ name: mocha
82
+ requirement: &70203557465420 !ruby/object:Gem::Requirement
112
83
  none: false
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- hash: 3
117
- segments:
118
- - 0
119
- version: "0"
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
120
88
  type: :development
121
- version_requirements: *id007
122
- - !ruby/object:Gem::Dependency
123
- name: bourne
124
89
  prerelease: false
125
- requirement: &id008 !ruby/object:Gem::Requirement
90
+ version_requirements: *70203557465420
91
+ - !ruby/object:Gem::Dependency
92
+ name: bourne
93
+ requirement: &70203557464620 !ruby/object:Gem::Requirement
126
94
  none: false
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- hash: 3
131
- segments:
132
- - 0
133
- version: "0"
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
134
99
  type: :development
135
- version_requirements: *id008
136
- - !ruby/object:Gem::Dependency
137
- name: appraisal
138
100
  prerelease: false
139
- requirement: &id009 !ruby/object:Gem::Requirement
101
+ version_requirements: *70203557464620
102
+ - !ruby/object:Gem::Dependency
103
+ name: appraisal
104
+ requirement: &70203557456720 !ruby/object:Gem::Requirement
140
105
  none: false
141
- requirements:
106
+ requirements:
142
107
  - - ~>
143
- - !ruby/object:Gem::Version
144
- hash: 3
145
- segments:
146
- - 0
147
- - 3
148
- - 8
108
+ - !ruby/object:Gem::Version
149
109
  version: 0.3.8
150
110
  type: :development
151
- version_requirements: *id009
152
- - !ruby/object:Gem::Dependency
153
- name: sqlite3-ruby
154
111
  prerelease: false
155
- requirement: &id010 !ruby/object:Gem::Requirement
112
+ version_requirements: *70203557456720
113
+ - !ruby/object:Gem::Dependency
114
+ name: sqlite3-ruby
115
+ requirement: &70203557455540 !ruby/object:Gem::Requirement
156
116
  none: false
157
- requirements:
158
- - - ">="
159
- - !ruby/object:Gem::Version
160
- hash: 3
161
- segments:
162
- - 0
163
- version: "0"
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
164
121
  type: :development
165
- version_requirements: *id010
166
- - !ruby/object:Gem::Dependency
167
- name: yard
168
122
  prerelease: false
169
- requirement: &id011 !ruby/object:Gem::Requirement
123
+ version_requirements: *70203557455540
124
+ - !ruby/object:Gem::Dependency
125
+ name: yard
126
+ requirement: &70203557454880 !ruby/object:Gem::Requirement
170
127
  none: false
171
- requirements:
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- hash: 3
175
- segments:
176
- - 0
177
- version: "0"
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
178
132
  type: :development
179
- version_requirements: *id011
180
- - !ruby/object:Gem::Dependency
181
- name: bluecloth
182
133
  prerelease: false
183
- requirement: &id012 !ruby/object:Gem::Requirement
134
+ version_requirements: *70203557454880
135
+ - !ruby/object:Gem::Dependency
136
+ name: bluecloth
137
+ requirement: &70203557453700 !ruby/object:Gem::Requirement
184
138
  none: false
185
- requirements:
186
- - - ">="
187
- - !ruby/object:Gem::Version
188
- hash: 3
189
- segments:
190
- - 0
191
- version: "0"
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
192
143
  type: :development
193
- version_requirements: *id012
194
- description: |-
195
- factory_girl provides a framework and DSL for defining and
196
- using factories - less error-prone, more explicit, and
197
- all-around easier to work with than fixtures.
144
+ prerelease: false
145
+ version_requirements: *70203557453700
146
+ description: ! "factory_girl provides a framework and DSL for defining and\n using
147
+ factories - less error-prone, more explicit, and\n all-around
148
+ easier to work with than fixtures."
198
149
  email: jferris@thoughtbot.com
199
150
  executables: []
200
-
201
151
  extensions: []
202
-
203
152
  extra_rdoc_files: []
204
-
205
- files:
153
+ files:
206
154
  - .autotest
207
155
  - .gitignore
208
156
  - .rspec
@@ -223,6 +171,7 @@ files:
223
171
  - lib/factory_girl/attribute/dynamic.rb
224
172
  - lib/factory_girl/attribute/sequence.rb
225
173
  - lib/factory_girl/attribute/static.rb
174
+ - lib/factory_girl/attribute_assigner.rb
226
175
  - lib/factory_girl/attribute_list.rb
227
176
  - lib/factory_girl/callback.rb
228
177
  - lib/factory_girl/declaration.rb
@@ -234,9 +183,12 @@ files:
234
183
  - lib/factory_girl/definition.rb
235
184
  - lib/factory_girl/definition_proxy.rb
236
185
  - lib/factory_girl/deprecated.rb
186
+ - lib/factory_girl/evaluator.rb
187
+ - lib/factory_girl/evaluator_class_definer.rb
237
188
  - lib/factory_girl/factory.rb
238
189
  - lib/factory_girl/find_definitions.rb
239
190
  - lib/factory_girl/null_factory.rb
191
+ - lib/factory_girl/null_object.rb
240
192
  - lib/factory_girl/proxy.rb
241
193
  - lib/factory_girl/proxy/attributes_for.rb
242
194
  - lib/factory_girl/proxy/build.rb
@@ -273,9 +225,13 @@ files:
273
225
  - gemfiles/3.0.gemfile.lock
274
226
  - gemfiles/3.1.gemfile
275
227
  - gemfiles/3.1.gemfile.lock
228
+ - gemfiles/3.2.gemfile
229
+ - gemfiles/3.2.gemfile.lock
230
+ - spec/acceptance/aliases_spec.rb
276
231
  - spec/acceptance/attribute_aliases_spec.rb
277
232
  - spec/acceptance/attribute_existing_on_object.rb
278
233
  - spec/acceptance/attributes_for_spec.rb
234
+ - spec/acceptance/attributes_from_instance_spec.rb
279
235
  - spec/acceptance/attributes_ordered_spec.rb
280
236
  - spec/acceptance/build_list_spec.rb
281
237
  - spec/acceptance/build_spec.rb
@@ -313,9 +269,11 @@ files:
313
269
  - spec/factory_girl/definition_proxy_spec.rb
314
270
  - spec/factory_girl/definition_spec.rb
315
271
  - spec/factory_girl/deprecated_spec.rb
272
+ - spec/factory_girl/evaluator_class_definer_spec.rb
316
273
  - spec/factory_girl/factory_spec.rb
317
274
  - spec/factory_girl/find_definitions_spec.rb
318
275
  - spec/factory_girl/null_factory_spec.rb
276
+ - spec/factory_girl/null_object_spec.rb
319
277
  - spec/factory_girl/proxy/attributes_for_spec.rb
320
278
  - spec/factory_girl/proxy/build_spec.rb
321
279
  - spec/factory_girl/proxy/create_spec.rb
@@ -331,41 +289,32 @@ files:
331
289
  - spec/support/matchers/delegate.rb
332
290
  - spec/support/matchers/trait.rb
333
291
  - spec/support/shared_examples/proxy.rb
334
- has_rdoc: true
335
292
  homepage: https://github.com/thoughtbot/factory_girl
336
293
  licenses: []
337
-
338
294
  post_install_message:
339
295
  rdoc_options: []
340
-
341
- require_paths:
296
+ require_paths:
342
297
  - lib
343
- required_ruby_version: !ruby/object:Gem::Requirement
298
+ required_ruby_version: !ruby/object:Gem::Requirement
344
299
  none: false
345
- requirements:
346
- - - ">="
347
- - !ruby/object:Gem::Version
348
- hash: 3
349
- segments:
350
- - 0
351
- version: "0"
352
- required_rubygems_version: !ruby/object:Gem::Requirement
300
+ requirements:
301
+ - - ! '>='
302
+ - !ruby/object:Gem::Version
303
+ version: 1.8.7
304
+ required_rubygems_version: !ruby/object:Gem::Requirement
353
305
  none: false
354
- requirements:
355
- - - ">="
356
- - !ruby/object:Gem::Version
357
- hash: 3
358
- segments:
359
- - 0
360
- version: "0"
306
+ requirements:
307
+ - - ! '>='
308
+ - !ruby/object:Gem::Version
309
+ version: '0'
361
310
  requirements: []
362
-
363
311
  rubyforge_project:
364
- rubygems_version: 1.6.2
312
+ rubygems_version: 1.8.10
365
313
  signing_key:
366
314
  specification_version: 3
367
- summary: factory_girl provides a framework and DSL for defining and using model instance factories.
368
- test_files:
315
+ summary: factory_girl provides a framework and DSL for defining and using model instance
316
+ factories.
317
+ test_files:
369
318
  - Appraisals
370
319
  - cucumber.yml
371
320
  - features/factory_girl_steps.feature
@@ -382,9 +331,13 @@ test_files:
382
331
  - gemfiles/3.0.gemfile.lock
383
332
  - gemfiles/3.1.gemfile
384
333
  - gemfiles/3.1.gemfile.lock
334
+ - gemfiles/3.2.gemfile
335
+ - gemfiles/3.2.gemfile.lock
336
+ - spec/acceptance/aliases_spec.rb
385
337
  - spec/acceptance/attribute_aliases_spec.rb
386
338
  - spec/acceptance/attribute_existing_on_object.rb
387
339
  - spec/acceptance/attributes_for_spec.rb
340
+ - spec/acceptance/attributes_from_instance_spec.rb
388
341
  - spec/acceptance/attributes_ordered_spec.rb
389
342
  - spec/acceptance/build_list_spec.rb
390
343
  - spec/acceptance/build_spec.rb
@@ -422,9 +375,11 @@ test_files:
422
375
  - spec/factory_girl/definition_proxy_spec.rb
423
376
  - spec/factory_girl/definition_spec.rb
424
377
  - spec/factory_girl/deprecated_spec.rb
378
+ - spec/factory_girl/evaluator_class_definer_spec.rb
425
379
  - spec/factory_girl/factory_spec.rb
426
380
  - spec/factory_girl/find_definitions_spec.rb
427
381
  - spec/factory_girl/null_factory_spec.rb
382
+ - spec/factory_girl/null_object_spec.rb
428
383
  - spec/factory_girl/proxy/attributes_for_spec.rb
429
384
  - spec/factory_girl/proxy/build_spec.rb
430
385
  - spec/factory_girl/proxy/create_spec.rb
@@ -440,3 +395,4 @@ test_files:
440
395
  - spec/support/matchers/delegate.rb
441
396
  - spec/support/matchers/trait.rb
442
397
  - spec/support/shared_examples/proxy.rb
398
+ has_rdoc: