pickle 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.1.20
2
+
3
+ * 1 minor enhancement
4
+ * Pickle now matches numeric field values preceded with a positive and negative sign eg +1.5 and -1 [schlick]
5
+
6
+
1
7
  == 0.1.19
2
8
 
3
9
  * 1 minor enhancement
@@ -9,10 +15,11 @@
9
15
  * 1 minor enhancement
10
16
  * release gem on gemcutter and code on github
11
17
 
18
+
12
19
  == 0.1.15 - 28 Aug 2009
13
20
 
14
21
  * 1 minor enhancement
15
- * avoid namespace collision on replace by renaming mapping#replace -> mapping#replacement [nruth]
22
+ * avoid namespace collision on replace by renaming mapping#replace -> mapping#replacement [nruth]
16
23
 
17
24
 
18
25
  == 0.1.14 - 9 July 2009
data/README.rdoc CHANGED
@@ -3,7 +3,7 @@
3
3
  Pickle gives you cucumber steps that create your models easily from factory-girl or
4
4
  machinist factories/blueprints. You can also just use ActiveRecord but it's not as cool.
5
5
 
6
- References to the models are stored, not necessarily for the purpose of checking the db
6
+ References to the models are stored in the current world, not necessarily for the purpose of checking the db
7
7
  (although you could use it for that), but for enabling easy reference to urls, and for
8
8
  building complex givens which require a bunch of models collaborating
9
9
 
@@ -24,7 +24,14 @@ Install pickle either as a rails plugin, or a gem
24
24
  # or, plugin as submodule
25
25
  git submodule add git://github.com/ianwhite/pickle.git vendor/plugins/pickle
26
26
 
27
-
27
+ == Contributors
28
+
29
+ The following people have Pickle better:
30
+
31
+ * {Nick Rutherford}[http://github.com/nruth]
32
+ * Tobi Knaup
33
+ * {Michael MacDonald}[http://github.com/schlick]
34
+
28
35
  == Get Started
29
36
 
30
37
  (you'd better install cucumber)
@@ -107,11 +114,11 @@ You can refer to other models in the fields
107
114
  And a person: "ethel" exists
108
115
  And a fatherhood exists with parent: user "fred", child: user "ethel"
109
116
 
110
- "Given <b>n</b> models exist", e.g.
117
+ "Given <b>n models</b> exist", e.g.
111
118
 
112
119
  Given 10 users exist
113
120
 
114
- "Given <b>n</b> <b>models</b> exist with <b>fields</b>", examples:
121
+ "Given <b>n models</b> exist with <b>fields</b>", examples:
115
122
 
116
123
  Given 10 users exist with activated: false
117
124
 
@@ -133,11 +140,11 @@ You can use other models, booleans, numerics, and strings as fields
133
140
  Then a user should exist with activated: false
134
141
  Then a user should exist with activated: true, email: "fred@gmail.com"
135
142
 
136
- "Then <b>n</b> <b>models</b> should exist", e.g.
143
+ "Then <b>n models</b> should exist", e.g.
137
144
 
138
145
  Then 10 events should exist
139
146
 
140
- "Then <b>n</b> <b>models</b> should exist with <b>fields</b>", e.g.
147
+ "Then <b>n models</b> should exist with <b>fields</b>", e.g.
141
148
 
142
149
  Then 2 people should exist with father: person "fred"
143
150
 
@@ -159,7 +166,7 @@ Many-to-one assocs: "Then <b>a model</b> should be [in|one of] <b>other model</b
159
166
  Then the user should have a status # => user.status?.should == true
160
167
  Then the car: "batmobile" should be fast # => car.fast?.should == true
161
168
 
162
- "Then <b>a model</b> should [be|have] [a|an] <b>predicate</b>", e.g.
169
+ "Then <b>a model</b> should not [be|have] [a|an] <b>predicate</b>", e.g.
163
170
 
164
171
  Then person: "fred" should not be childless # => fred.childless?.should == false
165
172
 
@@ -186,7 +193,9 @@ Pickle::Parser::Matchers for the methods available)
186
193
  end
187
194
 
188
195
  Then /^#{capture_model} should be one of #{capture_model}'s posts$/ do |post, forum|
189
- model(forum).posts.should include(post)
196
+ post = model!(post)
197
+ forum = model!(forum)
198
+ forum.posts.should include(post)
190
199
  end
191
200
 
192
201
  *capture_fields*
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.19
1
+ 0.1.20
data/features/app/app.rb CHANGED
@@ -28,6 +28,7 @@ ActiveRecord::Migration.suppress_messages do
28
28
 
29
29
  create_table :users, :force => true do |t|
30
30
  t.string :name, :status, :email
31
+ t.decimal :attitude_score, :precision => 4, :scale => 2
31
32
  end
32
33
  end
33
34
  end
@@ -52,12 +53,12 @@ class Tine < ActiveRecord::Base
52
53
  belongs_to :fork
53
54
  end
54
55
 
55
- # Machinist bluepriint for this
56
+ # Machinist blueprint for this
56
57
  class Spoon < ActiveRecord::Base
57
58
  validates_presence_of :name
58
59
  end
59
60
 
60
- # we don;t want abstract classes getting in there
61
+ # we don't want abstract classes getting in there
61
62
  class AbstractUser < ActiveRecord::Base
62
63
  self.abstract_class = true
63
64
  end
@@ -65,6 +66,9 @@ end
65
66
  # No factory or blueprint for this
66
67
  class User < AbstractUser
67
68
  validates_presence_of :name
69
+ def positive_person?
70
+ !attitude_score.nil? && attitude_score > 0
71
+ end
68
72
  end
69
73
 
70
74
  # controllers
@@ -17,4 +17,10 @@ Feature: I can easily create models from my blueprints
17
17
  Given I exist with status: "pwned", name: "fred"
18
18
  Then I should have a status
19
19
  And the user: "me" should have a status
20
-
20
+
21
+ Scenario: I create positive and negative users
22
+ Given a user exists with name: "Fred", attitude_score: +5.42
23
+ And another user exists with name: "Ethel", attitude_score: -1.46
24
+ Then 2 users should exist
25
+ And the 1st user should be a positive person
26
+ And the 2nd user should not be a positive person
@@ -22,7 +22,7 @@ module Pickle
22
22
  end
23
23
 
24
24
  def match_value
25
- "(?:\"#{match_quoted}\"|true|false|\\d+(?:\\.\\d+)?)"
25
+ "(?:\"#{match_quoted}\"|true|false|[+-]?\\d+(?:\\.\\d+)?)"
26
26
  end
27
27
 
28
28
  def match_field
data/pickle.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pickle}
8
- s.version = "0.1.19"
8
+ s.version = "0.1.20"
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"]
12
- s.date = %q{2009-10-20}
12
+ s.date = %q{2009-10-26}
13
13
  s.description = %q{Easy model creation and reference in your cucumber features}
14
14
  s.email = %q{ian.w.white@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -41,8 +41,8 @@ describe Pickle::Parser::Matchers do
41
41
  atom_should_match :match_label, [': "gday"', ': "gday mate"']
42
42
  atom_should_not_match :match_label, [': "gday""', ': gday']
43
43
 
44
- atom_should_match :match_field, ['foo: "this is the life"', 'bar_man: "and so is this"', 'boolean: false', 'boolean: true', 'numeric: 10', 'numeric: 12.5']
45
- atom_should_not_match :match_field, ['foo bar: "this aint workin"']
44
+ atom_should_match :match_field, ['foo: "this is the life"', 'bar_man: "and so is this"', 'boolean: false', 'boolean: true', 'numeric: 10', 'numeric: 12.5', 'numeric: +10', 'numeric: +12.5', 'numeric: -10', 'numeric: -12.5']
45
+ atom_should_not_match :match_field, ['foo bar: "this aint workin"', 'not_numeric: --10', 'not_numeric: -ten']
46
46
 
47
47
  atom_should_match :match_fields, ['foo: "bar"', 'foo: "bar", baz: "bah"']
48
48
  atom_should_not_match :match_fields, ['foo bar: "baz"', 'email: "a", password: "b", and password_confirmation: "c"']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pickle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian White
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-20 00:00:00 +01:00
12
+ date: 2009-10-26 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15