factory_girl_rails 1.1.beta1 → 1.1.beta2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -4
- data/Gemfile.lock +101 -26
- data/{README.rdoc → README.md} +24 -11
- data/features/load_definitions.feature +9 -7
- data/features/support/env.rb +5 -1
- metadata +64 -29
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,40 +1,115 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
factory_girl_rails (1.1.beta1)
|
5
|
+
factory_girl (~> 2.0.0.beta)
|
6
|
+
railties (>= 3.0.0)
|
7
|
+
|
1
8
|
GEM
|
2
9
|
remote: http://rubygems.org/
|
3
10
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
11
|
+
abstract (1.0.0)
|
12
|
+
actionmailer (3.0.7)
|
13
|
+
actionpack (= 3.0.7)
|
14
|
+
mail (~> 2.2.15)
|
15
|
+
actionpack (3.0.7)
|
16
|
+
activemodel (= 3.0.7)
|
17
|
+
activesupport (= 3.0.7)
|
10
18
|
builder (~> 2.1.2)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
19
|
+
erubis (~> 2.6.6)
|
20
|
+
i18n (~> 0.5.0)
|
21
|
+
rack (~> 1.2.1)
|
22
|
+
rack-mount (~> 0.6.14)
|
23
|
+
rack-test (~> 0.5.7)
|
24
|
+
tzinfo (~> 0.3.23)
|
25
|
+
activemodel (3.0.7)
|
26
|
+
activesupport (= 3.0.7)
|
27
|
+
builder (~> 2.1.2)
|
28
|
+
i18n (~> 0.5.0)
|
29
|
+
activerecord (3.0.7)
|
30
|
+
activemodel (= 3.0.7)
|
31
|
+
activesupport (= 3.0.7)
|
32
|
+
arel (~> 2.0.2)
|
33
|
+
tzinfo (~> 0.3.23)
|
34
|
+
activeresource (3.0.7)
|
35
|
+
activemodel (= 3.0.7)
|
36
|
+
activesupport (= 3.0.7)
|
37
|
+
activesupport (3.0.7)
|
38
|
+
arel (2.0.10)
|
39
|
+
aruba (0.4.3)
|
40
|
+
bcat (>= 0.6.1)
|
41
|
+
childprocess (>= 0.1.9)
|
42
|
+
cucumber (>= 0.10.7)
|
43
|
+
rdiscount (>= 1.6.8)
|
44
|
+
rspec (>= 2.6.0)
|
45
|
+
bcat (0.6.1)
|
46
|
+
rack (~> 1.0)
|
47
|
+
builder (2.1.2)
|
48
|
+
childprocess (0.1.9)
|
49
|
+
ffi (~> 1.0.6)
|
50
|
+
cucumber (1.0.0)
|
51
|
+
builder (>= 2.1.2)
|
52
|
+
diff-lcs (>= 1.1.2)
|
53
|
+
gherkin (~> 2.4.1)
|
54
|
+
json (>= 1.4.6)
|
55
|
+
term-ansicolor (>= 1.0.5)
|
15
56
|
diff-lcs (1.1.2)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
57
|
+
erubis (2.6.6)
|
58
|
+
abstract (>= 1.0.0)
|
59
|
+
factory_girl (2.0.0.beta3)
|
60
|
+
ffi (1.0.9)
|
61
|
+
gherkin (2.4.1)
|
62
|
+
json (>= 1.4.6)
|
63
|
+
i18n (0.5.0)
|
64
|
+
json (1.5.3)
|
65
|
+
mail (2.2.19)
|
66
|
+
activesupport (>= 2.3.6)
|
67
|
+
i18n (>= 0.4.0)
|
68
|
+
mime-types (~> 1.16)
|
69
|
+
treetop (~> 1.4.8)
|
70
|
+
mime-types (1.16)
|
71
|
+
polyglot (0.3.1)
|
72
|
+
rack (1.2.3)
|
73
|
+
rack-mount (0.6.14)
|
74
|
+
rack (>= 1.0.0)
|
75
|
+
rack-test (0.5.7)
|
76
|
+
rack (>= 1.0)
|
77
|
+
rails (3.0.7)
|
78
|
+
actionmailer (= 3.0.7)
|
79
|
+
actionpack (= 3.0.7)
|
80
|
+
activerecord (= 3.0.7)
|
81
|
+
activeresource (= 3.0.7)
|
82
|
+
activesupport (= 3.0.7)
|
83
|
+
bundler (~> 1.0)
|
84
|
+
railties (= 3.0.7)
|
85
|
+
railties (3.0.7)
|
86
|
+
actionpack (= 3.0.7)
|
87
|
+
activesupport (= 3.0.7)
|
88
|
+
rake (>= 0.8.7)
|
89
|
+
thor (~> 0.14.4)
|
20
90
|
rake (0.8.7)
|
21
|
-
|
22
|
-
|
23
|
-
rspec-
|
24
|
-
rspec-
|
25
|
-
|
26
|
-
rspec-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
rspec-expectations (= 2.0.0)
|
91
|
+
rdiscount (1.6.8)
|
92
|
+
rspec (2.6.0)
|
93
|
+
rspec-core (~> 2.6.0)
|
94
|
+
rspec-expectations (~> 2.6.0)
|
95
|
+
rspec-mocks (~> 2.6.0)
|
96
|
+
rspec-core (2.6.4)
|
97
|
+
rspec-expectations (2.6.0)
|
98
|
+
diff-lcs (~> 1.1.2)
|
99
|
+
rspec-mocks (2.6.0)
|
31
100
|
term-ansicolor (1.0.5)
|
101
|
+
thor (0.14.6)
|
102
|
+
treetop (1.4.9)
|
103
|
+
polyglot (>= 0.3.1)
|
104
|
+
tzinfo (0.3.27)
|
32
105
|
|
33
106
|
PLATFORMS
|
34
107
|
ruby
|
35
108
|
|
36
109
|
DEPENDENCIES
|
37
110
|
aruba
|
38
|
-
cucumber
|
111
|
+
cucumber (~> 1.0.0)
|
112
|
+
factory_girl_rails!
|
113
|
+
rails (= 3.0.7)
|
39
114
|
rake
|
40
|
-
rspec
|
115
|
+
rspec (~> 2.6.0)
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
factory_girl
|
2
|
+
============
|
2
3
|
|
3
4
|
factory_girl is a fixtures replacement with a straightforward definition
|
4
5
|
syntax, support for multiple build strategies (saved instances, unsaved
|
@@ -6,34 +7,46 @@ instances, attribute hashes, and stubbed objects), and support for multiple
|
|
6
7
|
factories for the same class (user, admin_user, and so on), including factory
|
7
8
|
inheritance.
|
8
9
|
|
9
|
-
|
10
|
+
Rails
|
11
|
+
-----
|
10
12
|
|
11
13
|
factory_girl_rails provides Rails integration for factory_girl. All
|
12
14
|
Rails-specific features are only compatible with Rails 3.
|
13
15
|
|
14
16
|
Currenty, automatic factory definition loading is the only Rails-specific feature.
|
15
17
|
|
16
|
-
|
18
|
+
Download
|
19
|
+
--------
|
17
20
|
|
18
21
|
Github: http://github.com/thoughtbot/factory_girl_rails/tree/master
|
19
22
|
|
20
23
|
Gem:
|
21
|
-
|
24
|
+
gem install factory_girl_rails
|
22
25
|
|
23
|
-
|
26
|
+
Configuration
|
27
|
+
-------------
|
24
28
|
|
25
29
|
Add factory_girl Rails to your Gemfile:
|
26
30
|
|
27
|
-
|
31
|
+
gem 'factory_girl_rails'
|
28
32
|
|
29
|
-
|
33
|
+
More Information
|
34
|
+
----------------
|
30
35
|
|
31
36
|
factory_girl: http://github.com/thoughtbot/factory_girl/tree/master
|
32
37
|
|
33
|
-
|
38
|
+
Credits
|
39
|
+
-------
|
34
40
|
|
35
|
-
|
41
|
+
factory_girl was originally written by Joe Ferris
|
36
42
|
|
37
|
-
|
43
|
+
![thoughtbot](http://thoughtbot.com/images/tm/logo.png)
|
38
44
|
|
39
|
-
|
45
|
+
factory_girl is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community)
|
46
|
+
|
47
|
+
The names and logos for thoughtbot are trademarks of thoughtbot, inc.
|
48
|
+
|
49
|
+
License
|
50
|
+
-------
|
51
|
+
|
52
|
+
factory_girl is Copyright © 2008-2011 Joe Ferris and thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.
|
@@ -2,10 +2,10 @@ Feature: automatically load step definitions
|
|
2
2
|
|
3
3
|
@disable-bundler
|
4
4
|
Scenario: generate a rails 3 application and use factory definitions
|
5
|
-
When I successfully run
|
5
|
+
When I successfully run `bundle exec rails new testapp`
|
6
6
|
And I cd to "testapp"
|
7
7
|
And I add "factory_girl_rails" from this project as a dependency
|
8
|
-
When I successfully run
|
8
|
+
When I successfully run `bundle install`
|
9
9
|
And I write to "db/migrate/1_create_users.rb" with:
|
10
10
|
"""
|
11
11
|
class CreateUsers < ActiveRecord::Migration
|
@@ -16,7 +16,7 @@ Feature: automatically load step definitions
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
"""
|
19
|
-
When I successfully run
|
19
|
+
When I successfully run `bundle exec rake db:migrate --trace`
|
20
20
|
And I write to "app/models/user.rb" with:
|
21
21
|
"""
|
22
22
|
class User < ActiveRecord::Base
|
@@ -24,8 +24,10 @@ Feature: automatically load step definitions
|
|
24
24
|
"""
|
25
25
|
When I write to "test/factories.rb" with:
|
26
26
|
"""
|
27
|
-
|
28
|
-
user
|
27
|
+
FactoryGirl.define do
|
28
|
+
factory :user do
|
29
|
+
name "Frank"
|
30
|
+
end
|
29
31
|
end
|
30
32
|
"""
|
31
33
|
When I write to "test/unit/user_test.rb" with:
|
@@ -34,10 +36,10 @@ Feature: automatically load step definitions
|
|
34
36
|
|
35
37
|
class UserTest < ActiveSupport::TestCase
|
36
38
|
test "use factory" do
|
37
|
-
user =
|
39
|
+
user = FactoryGirl.create(:user)
|
38
40
|
assert_equal 'Frank', user.name
|
39
41
|
end
|
40
42
|
end
|
41
43
|
"""
|
42
|
-
When I successfully run
|
44
|
+
When I successfully run `bundle exec rake test --trace`
|
43
45
|
Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors"
|
data/features/support/env.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factory_girl_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 62196303
|
5
|
+
prerelease: 4
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
|
9
|
+
- beta
|
10
|
+
- 2
|
11
|
+
version: 1.1.beta2
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Joe Ferris
|
@@ -15,14 +16,13 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date:
|
19
|
+
date: 2011-06-29 00:00:00 -04:00
|
19
20
|
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
23
|
+
name: railties
|
23
24
|
prerelease: false
|
24
|
-
|
25
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
26
|
none: false
|
27
27
|
requirements:
|
28
28
|
- - ">="
|
@@ -33,12 +33,12 @@ dependencies:
|
|
33
33
|
- 0
|
34
34
|
- 0
|
35
35
|
version: 3.0.0
|
36
|
-
requirement: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
36
|
type: :runtime
|
39
|
-
|
37
|
+
version_requirements: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
40
39
|
name: factory_girl
|
41
|
-
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
43
|
requirements:
|
44
44
|
- - ~>
|
@@ -50,12 +50,12 @@ dependencies:
|
|
50
50
|
- 0
|
51
51
|
- beta
|
52
52
|
version: 2.0.0.beta
|
53
|
-
|
53
|
+
type: :runtime
|
54
|
+
version_requirements: *id002
|
54
55
|
- !ruby/object:Gem::Dependency
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
56
|
name: rake
|
58
|
-
|
57
|
+
prerelease: false
|
58
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
59
|
none: false
|
60
60
|
requirements:
|
61
61
|
- - ">="
|
@@ -64,26 +64,44 @@ dependencies:
|
|
64
64
|
segments:
|
65
65
|
- 0
|
66
66
|
version: "0"
|
67
|
-
requirement: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
67
|
type: :development
|
70
|
-
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
71
70
|
name: rspec
|
72
|
-
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
hash:
|
77
|
+
hash: 23
|
78
78
|
segments:
|
79
|
+
- 2
|
80
|
+
- 6
|
79
81
|
- 0
|
80
|
-
version:
|
81
|
-
|
82
|
+
version: 2.6.0
|
83
|
+
type: :development
|
84
|
+
version_requirements: *id004
|
82
85
|
- !ruby/object:Gem::Dependency
|
86
|
+
name: cucumber
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
hash: 23
|
94
|
+
segments:
|
95
|
+
- 1
|
96
|
+
- 0
|
97
|
+
- 0
|
98
|
+
version: 1.0.0
|
83
99
|
type: :development
|
100
|
+
version_requirements: *id005
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: aruba
|
84
103
|
prerelease: false
|
85
|
-
|
86
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
104
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
87
105
|
none: false
|
88
106
|
requirements:
|
89
107
|
- - ">="
|
@@ -92,7 +110,24 @@ dependencies:
|
|
92
110
|
segments:
|
93
111
|
- 0
|
94
112
|
version: "0"
|
95
|
-
|
113
|
+
type: :development
|
114
|
+
version_requirements: *id006
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: rails
|
117
|
+
prerelease: false
|
118
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
119
|
+
none: false
|
120
|
+
requirements:
|
121
|
+
- - "="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
hash: 9
|
124
|
+
segments:
|
125
|
+
- 3
|
126
|
+
- 0
|
127
|
+
- 7
|
128
|
+
version: 3.0.7
|
129
|
+
type: :development
|
130
|
+
version_requirements: *id007
|
96
131
|
description: |-
|
97
132
|
factory_girl_rails provides integration between
|
98
133
|
factory_girl and rails 3 (currently just automatic factory definition
|
@@ -109,7 +144,7 @@ files:
|
|
109
144
|
- Gemfile.lock
|
110
145
|
- LICENSE
|
111
146
|
- Rakefile
|
112
|
-
- README.
|
147
|
+
- README.md
|
113
148
|
- lib/factory_girl_rails/railtie.rb
|
114
149
|
- lib/factory_girl_rails.rb
|
115
150
|
- features/load_definitions.feature
|
@@ -147,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
182
|
requirements: []
|
148
183
|
|
149
184
|
rubyforge_project:
|
150
|
-
rubygems_version: 1.
|
185
|
+
rubygems_version: 1.6.2
|
151
186
|
signing_key:
|
152
187
|
specification_version: 3
|
153
188
|
summary: factory_girl_rails provides integration between factory_girl and rails 3
|