pickle 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/History.txt +7 -0
  2. data/README.rdoc +23 -6
  3. data/VERSION +1 -1
  4. data/pickle.gemspec +1 -1
  5. metadata +3 -3
@@ -1,3 +1,10 @@
1
+ == 0.4.1
2
+ Docfix
3
+
4
+ * 1 improvement
5
+ * documentation fixes, and example of writing your own pickle steps
6
+
7
+
1
8
  == 0.4.0
2
9
  Mongoid adapter, fallback ORM adapter for those not using machinist or active_record, bugfixes
3
10
 
@@ -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 DataMapper
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, then factory-girl. If you want to use active-record 'factories' you should add ":active_record" to adapters. 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).
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: "fred" exists
167
- And a person: "ethel" exists
168
- And a fatherhood exists with parent: user "fred", child: user "ethel"
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.0
1
+ 0.4.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pickle}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ian White"]
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: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ian White