pickle 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/README.rdoc +23 -6
- data/VERSION +1 -1
- data/pickle.gemspec +1 -1
- metadata +3 -3
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -74,7 +74,7 @@ The code/steps will be written to <tt>features/env/paths.rb</tt> and
|
|
74
74
|
|
75
75
|
=== Using with plain ole Active Record, DataMapper or Mongoid
|
76
76
|
|
77
|
-
Pickle comes with adapters for Active Record, DataMapper and Mongoid.
|
77
|
+
Pickle comes with ORM adapters for Active Record, DataMapper and Mongoid.
|
78
78
|
|
79
79
|
If you have a model called 'Post', with required fields 'title', and 'body', then you can now write
|
80
80
|
steps like this
|
@@ -109,7 +109,7 @@ If that doesn't solve loading issues then require your factories.rb file directl
|
|
109
109
|
# example features/support/factory_girl.rb
|
110
110
|
require File.dirname(__FILE__) + '/../../spec/factories'
|
111
111
|
|
112
|
-
=== Using with an ORM other than ActiveRecord or
|
112
|
+
=== Using with an ORM other than ActiveRecord, DataMapper, or Mongoid
|
113
113
|
|
114
114
|
Pickle can be used with any modelling library provided there is an adapter written for it.
|
115
115
|
|
@@ -137,7 +137,9 @@ In: <tt>features/support/pickle.rb</tt>
|
|
137
137
|
config.map 'me', 'myself', 'my', 'I', :to => 'user: "me"'
|
138
138
|
end
|
139
139
|
|
140
|
-
Out of the box pickle looks for machinist,
|
140
|
+
Out of the box pickle looks for machinist, factory-girl, then uses the ORM(s) that you're using to create models.
|
141
|
+
|
142
|
+
If you find that your steps aren't working with your factories, it's probably the case that your factory setup is not being included in your cucumber environment (see comments above regarding machinist and factory-girl).
|
141
143
|
|
142
144
|
== API
|
143
145
|
|
@@ -157,15 +159,30 @@ When you run <tt>script/generate pickle</tt> you get the following steps
|
|
157
159
|
|
158
160
|
Given a user exists with name: "Fred"
|
159
161
|
Given a user exists with name: "Fred", activated: false
|
162
|
+
|
163
|
+
This last step could be better expressed by using Machinist/FactoryGirl to create an activated user. Then you can do
|
164
|
+
|
165
|
+
Given an activated user exists with name: "Fred"
|
160
166
|
|
161
167
|
You can refer to other models in the fields
|
162
168
|
|
163
169
|
Given a user exists
|
164
170
|
And a post exists with author: the user
|
165
171
|
|
166
|
-
Given a person
|
167
|
-
And a person
|
168
|
-
And a fatherhood exists with parent:
|
172
|
+
Given a person "fred" exists
|
173
|
+
And a person "ethel" exists
|
174
|
+
And a fatherhood exists with parent: person "fred", child: person "ethel"
|
175
|
+
|
176
|
+
This last step is given by the default pickle steps, but it would be better written as:
|
177
|
+
|
178
|
+
And "fred" is the father of "ethel"
|
179
|
+
|
180
|
+
It is expected that you'll need to expand upon the default pickle steps to make your features readable. To write the
|
181
|
+
above step, you could do something like:
|
182
|
+
|
183
|
+
Given /^"(\w+)" is the father of "(\w+)"$/ do |father, child|
|
184
|
+
Fatherhood.create! :father => model!("person: \"#{father}\""), :child => model!("person: \"#{child}\"")
|
185
|
+
end
|
169
186
|
|
170
187
|
"Given <b>n models</b> exist", e.g.
|
171
188
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/pickle.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pickle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ian White
|