factory_girl 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,11 +6,11 @@ Update Your Gemfile
6
6
 
7
7
  If you're using Rails, you'll need to upgrade `factory_girl_rails` to the latest RC:
8
8
 
9
- gem "factory_girl_rails", "~> 1.1.rc1"
9
+ gem "factory_girl_rails", "~> 1.1"
10
10
 
11
11
  If you're *not* using Rails, you'll just have to change the required version of `factory_girl`:
12
12
 
13
- gem "factory_girl", "~> 2.0.0.rc1"
13
+ gem "factory_girl", "~> 2.0.0"
14
14
 
15
15
  Once your Gemfile is updated, you'll want to update your bundle.
16
16
 
@@ -308,6 +308,13 @@ To set the attributes for each of the factories, you can pass in a hash as you n
308
308
 
309
309
  twenty_year_olds = FactoryGirl.build_list(:user, 25, :date_of_birth => 20.years.ago)
310
310
 
311
+ Cucumber Integration
312
+ --------------------
313
+
314
+ factory_girl ships with step definitions that make calling factories from Cucumber easier. To use them:
315
+
316
+ require 'factory_girl/step_definitions'
317
+
311
318
  Alternate Syntaxes
312
319
  ------------------
313
320
 
@@ -190,3 +190,11 @@ Feature: Use step definitions generated by factories
190
190
  Then I should find the following for the last user:
191
191
  | id | name |
192
192
  | 123 | Joe |
193
+
194
+ Scenario: pass a factory girl table as an argument and modify it
195
+ Given these super users exist:
196
+ | id | Name |
197
+ | 123 | Joe |
198
+ Then I should find the following for the last user:
199
+ | id | name | admin |
200
+ | 123 | Joe | true |
@@ -16,3 +16,10 @@ end
16
16
  When /^I create a "([^"]*)" instance from Factory Girl$/ do |factory_name|
17
17
  FactoryGirl.create(factory_name)
18
18
  end
19
+
20
+ Given /^these super users exist:$/ do |table|
21
+ headers = table.headers + ["admin"]
22
+ rows = table.rows.map { |row| row + [true] }
23
+ new_table = Cucumber::Ast::Table.new([headers] + rows)
24
+ Given %{the following person exists:}, new_table
25
+ end
Binary file
@@ -21,7 +21,7 @@ module FactoryGirlStepHelpers
21
21
  private
22
22
 
23
23
  def process_key_value(key, value)
24
- [key.downcase.gsub(' ', '_').to_sym, value.strip]
24
+ [key.downcase.gsub(' ', '_').to_sym, value.to_s.strip]
25
25
  end
26
26
 
27
27
  class AssociationManager
@@ -1,4 +1,4 @@
1
1
  module FactoryGirl
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factory_girl
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
5
4
  prerelease:
6
- segments:
7
- - 2
8
- - 0
9
- - 1
10
- version: 2.0.1
5
+ version: 2.0.2
11
6
  platform: ruby
12
7
  authors:
13
8
  - Joe Ferris
@@ -15,8 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-07-22 00:00:00 -04:00
19
- default_executable:
13
+ date: 2011-07-28 00:00:00 Z
20
14
  dependencies:
21
15
  - !ruby/object:Gem::Dependency
22
16
  name: rcov
@@ -26,9 +20,6 @@ dependencies:
26
20
  requirements:
27
21
  - - ">="
28
22
  - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
23
  version: "0"
33
24
  type: :development
34
25
  version_requirements: *id001
@@ -40,9 +31,6 @@ dependencies:
40
31
  requirements:
41
32
  - - ">="
42
33
  - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
34
  version: "0"
47
35
  type: :development
48
36
  version_requirements: *id002
@@ -54,9 +42,6 @@ dependencies:
54
42
  requirements:
55
43
  - - ">="
56
44
  - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
45
  version: "0"
61
46
  type: :development
62
47
  version_requirements: *id003
@@ -68,11 +53,6 @@ dependencies:
68
53
  requirements:
69
54
  - - ~>
70
55
  - !ruby/object:Gem::Version
71
- hash: 9
72
- segments:
73
- - 2
74
- - 3
75
- - 5
76
56
  version: 2.3.5
77
57
  type: :development
78
58
  version_requirements: *id004
@@ -84,13 +64,6 @@ dependencies:
84
64
  requirements:
85
65
  - - ~>
86
66
  - !ruby/object:Gem::Version
87
- hash: 62196421
88
- segments:
89
- - 3
90
- - 0
91
- - 0
92
- - beta
93
- - 3
94
67
  version: 3.0.0.beta3
95
68
  type: :development
96
69
  version_requirements: *id005
@@ -102,9 +75,6 @@ dependencies:
102
75
  requirements:
103
76
  - - ">="
104
77
  - !ruby/object:Gem::Version
105
- hash: 3
106
- segments:
107
- - 0
108
78
  version: "0"
109
79
  type: :development
110
80
  version_requirements: *id006
@@ -116,9 +86,6 @@ dependencies:
116
86
  requirements:
117
87
  - - ">="
118
88
  - !ruby/object:Gem::Version
119
- hash: 3
120
- segments:
121
- - 0
122
89
  version: "0"
123
90
  type: :development
124
91
  version_requirements: *id007
@@ -130,9 +97,6 @@ dependencies:
130
97
  requirements:
131
98
  - - ">="
132
99
  - !ruby/object:Gem::Version
133
- hash: 3
134
- segments:
135
- - 0
136
100
  version: "0"
137
101
  type: :development
138
102
  version_requirements: *id008
@@ -235,7 +199,6 @@ files:
235
199
  - features/support/env.rb
236
200
  - features/support/factories.rb
237
201
  - features/support/test.db
238
- has_rdoc: true
239
202
  homepage: https://github.com/thoughtbot/factory_girl
240
203
  licenses: []
241
204
 
@@ -249,23 +212,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
249
212
  requirements:
250
213
  - - ">="
251
214
  - !ruby/object:Gem::Version
252
- hash: 3
253
- segments:
254
- - 0
255
215
  version: "0"
256
216
  required_rubygems_version: !ruby/object:Gem::Requirement
257
217
  none: false
258
218
  requirements:
259
219
  - - ">="
260
220
  - !ruby/object:Gem::Version
261
- hash: 3
262
- segments:
263
- - 0
264
221
  version: "0"
265
222
  requirements: []
266
223
 
267
224
  rubyforge_project:
268
- rubygems_version: 1.6.2
225
+ rubygems_version: 1.8.5
269
226
  signing_key:
270
227
  specification_version: 3
271
228
  summary: factory_girl provides a framework and DSL for defining and using model instance factories.