pickle 0.4.11 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +2 -0
- data/.travis.yml +10 -0
- data/Gemfile.lock.development +91 -94
- data/History.txt +8 -1
- data/README.rdoc +8 -9
- data/Rakefile.d/cucumber.rake +10 -9
- data/features/app/blueprints.rb +1 -6
- data/features/app/factories.rb +17 -15
- data/features/step_definitions/email_steps.rb +10 -10
- data/features/step_definitions/fork_steps.rb +2 -2
- data/features/step_definitions/generator_steps.rb +15 -9
- data/features/step_definitions/path_steps.rb +3 -3
- data/features/step_definitions/pickle_steps.rb +19 -19
- data/features/step_definitions/raise_error_steps.rb +3 -3
- data/features/support/pickle.rb +0 -1
- data/lib/generators/pickle_generator.rb +1 -26
- data/lib/pickle/adapter.rb +4 -10
- data/lib/pickle/version.rb +2 -2
- data/pickle.gemspec +7 -6
- data/rails_generators/pickle/pickle_generator.rb +2 -4
- data/rails_generators/pickle/templates/email_steps.rb +10 -10
- data/rails_generators/pickle/templates/pickle.rb +0 -1
- data/rails_generators/pickle/templates/pickle_steps.rb +19 -19
- data/spec/pickle/adapter_spec.rb +39 -39
- data/spec/pickle/config_spec.rb +29 -29
- data/spec/pickle/email/parser_spec.rb +9 -9
- data/spec/pickle/email_spec.rb +38 -38
- data/spec/pickle/parser/matchers_spec.rb +8 -8
- data/spec/pickle/parser_spec.rb +34 -34
- data/spec/pickle/path_spec.rb +33 -33
- data/spec/pickle/session_spec.rb +87 -87
- data/spec/pickle_spec.rb +4 -4
- data/spec/spec_helper.rb +73 -3
- metadata +55 -79
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8730ddaad2e1e21064b59b145a05766f77be5d9c
|
4
|
+
data.tar.gz: 74edf4182c09e69e45bc478d0d370a6210f9aa96
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1c19f299257c90276c96c52e36b954af848432669c47fe60e297a40e3bdcc105662fa7219c384c932c8c8fb7b92378f6d98413cf3655e001ed7f1fc5d25eaac7
|
7
|
+
data.tar.gz: be13a9cb03e8f3f42f6e043c26fb43bacdfa20e6c6fa7cf06fcec0933488aa3fcfd503da10ea995940f9b790ad3ae6d35e96ecda66f3d25da00eb6c11717bd0b
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile.lock.development
CHANGED
@@ -8,140 +8,137 @@ PATH
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionmailer (3.1.
|
12
|
-
actionpack (= 3.1.
|
13
|
-
mail (~> 2.
|
14
|
-
actionpack (3.1.
|
15
|
-
activemodel (= 3.1.
|
16
|
-
activesupport (= 3.1.
|
11
|
+
actionmailer (3.1.12)
|
12
|
+
actionpack (= 3.1.12)
|
13
|
+
mail (~> 2.4.4)
|
14
|
+
actionpack (3.1.12)
|
15
|
+
activemodel (= 3.1.12)
|
16
|
+
activesupport (= 3.1.12)
|
17
17
|
builder (~> 3.0.0)
|
18
18
|
erubis (~> 2.7.0)
|
19
19
|
i18n (~> 0.6)
|
20
20
|
rack (~> 1.3.6)
|
21
|
-
rack-cache (~> 1.
|
21
|
+
rack-cache (~> 1.2)
|
22
22
|
rack-mount (~> 0.8.2)
|
23
23
|
rack-test (~> 0.6.1)
|
24
|
-
sprockets (~> 2.0.
|
25
|
-
activemodel (3.1.
|
26
|
-
activesupport (= 3.1.
|
24
|
+
sprockets (~> 2.0.4)
|
25
|
+
activemodel (3.1.12)
|
26
|
+
activesupport (= 3.1.12)
|
27
27
|
builder (~> 3.0.0)
|
28
28
|
i18n (~> 0.6)
|
29
|
-
activerecord (3.1.
|
30
|
-
activemodel (= 3.1.
|
31
|
-
activesupport (= 3.1.
|
29
|
+
activerecord (3.1.12)
|
30
|
+
activemodel (= 3.1.12)
|
31
|
+
activesupport (= 3.1.12)
|
32
32
|
arel (~> 2.2.3)
|
33
33
|
tzinfo (~> 0.3.29)
|
34
|
-
activeresource (3.1.
|
35
|
-
activemodel (= 3.1.
|
36
|
-
activesupport (= 3.1.
|
37
|
-
activesupport (3.1.
|
34
|
+
activeresource (3.1.12)
|
35
|
+
activemodel (= 3.1.12)
|
36
|
+
activesupport (= 3.1.12)
|
37
|
+
activesupport (3.1.12)
|
38
38
|
multi_json (~> 1.0)
|
39
39
|
arel (2.2.3)
|
40
|
-
builder (3.0.
|
41
|
-
capybara (
|
40
|
+
builder (3.0.4)
|
41
|
+
capybara (2.4.1)
|
42
42
|
mime-types (>= 1.16)
|
43
43
|
nokogiri (>= 1.3.3)
|
44
44
|
rack (>= 1.0.0)
|
45
45
|
rack-test (>= 0.5.4)
|
46
|
-
|
47
|
-
|
48
|
-
childprocess (0.3.1)
|
49
|
-
ffi (~> 1.0.6)
|
50
|
-
cucumber (1.1.9)
|
46
|
+
xpath (~> 2.0)
|
47
|
+
cucumber (1.3.16)
|
51
48
|
builder (>= 2.1.2)
|
52
|
-
diff-lcs (>= 1.1.
|
53
|
-
gherkin (~> 2.
|
54
|
-
|
55
|
-
|
56
|
-
cucumber-rails (1.
|
57
|
-
capybara (>= 1.1.2)
|
58
|
-
cucumber (>= 1.
|
59
|
-
|
60
|
-
|
61
|
-
|
49
|
+
diff-lcs (>= 1.1.3)
|
50
|
+
gherkin (~> 2.12)
|
51
|
+
multi_json (>= 1.7.5, < 2.0)
|
52
|
+
multi_test (>= 0.1.1)
|
53
|
+
cucumber-rails (1.4.1)
|
54
|
+
capybara (>= 1.1.2, < 3)
|
55
|
+
cucumber (>= 1.3.8, < 2)
|
56
|
+
mime-types (~> 1.16)
|
57
|
+
nokogiri (~> 1.5)
|
58
|
+
rails (>= 3, < 5)
|
59
|
+
database_cleaner (1.3.0)
|
60
|
+
diff-lcs (1.2.5)
|
62
61
|
erubis (2.7.0)
|
63
|
-
fabrication (
|
64
|
-
factory_girl (
|
62
|
+
fabrication (2.11.3)
|
63
|
+
factory_girl (4.4.0)
|
65
64
|
activesupport (>= 3.0.0)
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
mail (2.3.3)
|
65
|
+
gherkin (2.12.2)
|
66
|
+
multi_json (~> 1.3)
|
67
|
+
git (1.2.8)
|
68
|
+
hike (1.2.3)
|
69
|
+
i18n (0.6.11)
|
70
|
+
json (1.8.1)
|
71
|
+
machinist (2.0)
|
72
|
+
mail (2.4.4)
|
75
73
|
i18n (>= 0.4.0)
|
76
74
|
mime-types (~> 1.16)
|
77
75
|
treetop (~> 1.4.8)
|
78
|
-
mime-types (1.
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
76
|
+
mime-types (1.25.1)
|
77
|
+
mini_portile (0.6.0)
|
78
|
+
multi_json (1.10.1)
|
79
|
+
multi_test (0.1.1)
|
80
|
+
nokogiri (1.6.3.1)
|
81
|
+
mini_portile (= 0.6.0)
|
82
|
+
polyglot (0.3.5)
|
83
|
+
rack (1.3.10)
|
83
84
|
rack-cache (1.2)
|
84
85
|
rack (>= 0.4)
|
85
86
|
rack-mount (0.8.3)
|
86
87
|
rack (>= 1.0.0)
|
87
|
-
rack-ssl (1.3.
|
88
|
+
rack-ssl (1.3.4)
|
88
89
|
rack
|
89
|
-
rack-test (0.6.
|
90
|
+
rack-test (0.6.2)
|
90
91
|
rack (>= 1.0)
|
91
|
-
rails (3.1.
|
92
|
-
actionmailer (= 3.1.
|
93
|
-
actionpack (= 3.1.
|
94
|
-
activerecord (= 3.1.
|
95
|
-
activeresource (= 3.1.
|
96
|
-
activesupport (= 3.1.
|
92
|
+
rails (3.1.12)
|
93
|
+
actionmailer (= 3.1.12)
|
94
|
+
actionpack (= 3.1.12)
|
95
|
+
activerecord (= 3.1.12)
|
96
|
+
activeresource (= 3.1.12)
|
97
|
+
activesupport (= 3.1.12)
|
97
98
|
bundler (~> 1.0)
|
98
|
-
railties (= 3.1.
|
99
|
-
railties (3.1.
|
100
|
-
actionpack (= 3.1.
|
101
|
-
activesupport (= 3.1.
|
99
|
+
railties (= 3.1.12)
|
100
|
+
railties (3.1.12)
|
101
|
+
actionpack (= 3.1.12)
|
102
|
+
activesupport (= 3.1.12)
|
102
103
|
rack-ssl (~> 1.3.2)
|
103
104
|
rake (>= 0.8.7)
|
104
105
|
rdoc (~> 3.4)
|
105
106
|
thor (~> 0.14.6)
|
106
|
-
rake (
|
107
|
-
rdoc (3.12)
|
107
|
+
rake (10.3.2)
|
108
|
+
rdoc (3.12.2)
|
108
109
|
json (~> 1.4)
|
109
|
-
rspec (
|
110
|
-
rspec-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
rspec-
|
115
|
-
|
116
|
-
rspec-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
rspec (~>
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
multi_json (~> 1.0)
|
127
|
-
rubyzip
|
128
|
-
sprockets (2.0.3)
|
110
|
+
rspec-core (3.0.3)
|
111
|
+
rspec-support (~> 3.0.0)
|
112
|
+
rspec-expectations (3.0.3)
|
113
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
114
|
+
rspec-support (~> 3.0.0)
|
115
|
+
rspec-mocks (3.0.3)
|
116
|
+
rspec-support (~> 3.0.0)
|
117
|
+
rspec-rails (3.0.2)
|
118
|
+
actionpack (>= 3.0)
|
119
|
+
activesupport (>= 3.0)
|
120
|
+
railties (>= 3.0)
|
121
|
+
rspec-core (~> 3.0.0)
|
122
|
+
rspec-expectations (~> 3.0.0)
|
123
|
+
rspec-mocks (~> 3.0.0)
|
124
|
+
rspec-support (~> 3.0.0)
|
125
|
+
rspec-support (3.0.3)
|
126
|
+
sprockets (2.0.4)
|
129
127
|
hike (~> 1.2)
|
130
128
|
rack (~> 1.0)
|
131
129
|
tilt (~> 1.1, != 1.3.0)
|
132
|
-
sqlite3 (1.3.
|
130
|
+
sqlite3 (1.3.9)
|
133
131
|
sqlite3-ruby (1.3.3)
|
134
132
|
sqlite3 (>= 1.3.3)
|
135
|
-
term-ansicolor (1.0.7)
|
136
133
|
thor (0.14.6)
|
137
|
-
tilt (1.
|
138
|
-
treetop (1.4.
|
134
|
+
tilt (1.4.1)
|
135
|
+
treetop (1.4.15)
|
139
136
|
polyglot
|
140
137
|
polyglot (>= 0.3.1)
|
141
|
-
tzinfo (0.3.
|
142
|
-
xpath (0.
|
138
|
+
tzinfo (0.3.41)
|
139
|
+
xpath (2.0.0)
|
143
140
|
nokogiri (~> 1.3)
|
144
|
-
yard (0.7.
|
141
|
+
yard (0.8.7.4)
|
145
142
|
|
146
143
|
PLATFORMS
|
147
144
|
ruby
|
@@ -151,13 +148,13 @@ DEPENDENCIES
|
|
151
148
|
capybara
|
152
149
|
cucumber-rails
|
153
150
|
database_cleaner
|
154
|
-
fabrication
|
151
|
+
fabrication (~> 2.0)
|
155
152
|
factory_girl
|
156
153
|
git
|
157
|
-
machinist
|
154
|
+
machinist (~> 2.0)
|
158
155
|
pickle!
|
159
156
|
rack
|
160
157
|
rails (~> 3.1.0)
|
161
|
-
rspec-rails (~>
|
158
|
+
rspec-rails (~> 3.0)
|
162
159
|
sqlite3-ruby
|
163
160
|
yard
|
data/History.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 0.5.0
|
2
|
+
|
3
|
+
* Drop support for Machinist 1 [James Le Cuirot]
|
4
|
+
* Improve support for latest Fabrication and factory_girl [James Le Cuirot]
|
5
|
+
* Fix installation under recent cucumber-rails versions [James Le Cuirot]
|
6
|
+
* Fix up tests, including full migration to RSpec 3 [James Le Cuirot, Niklas Hofer]
|
7
|
+
|
1
8
|
== 0.4.11
|
2
9
|
|
3
10
|
* 1 minor improvement
|
@@ -474,4 +481,4 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
|
|
474
481
|
|
475
482
|
== Prior to gems
|
476
483
|
|
477
|
-
* Initial release: everything is subject to sweeping change
|
484
|
+
* Initial release: everything is subject to sweeping change
|
data/README.rdoc
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
= pickle
|
2
2
|
|
3
|
+
{<img src="https://travis-ci.org/ianwhite/pickle.svg" alt="Build Status" />}[https://travis-ci.org/ianwhite/pickle]
|
4
|
+
|
3
5
|
Pickle gives you cucumber steps that create your models easily from factory-girl,
|
4
6
|
machinist, or fabrication. You can also just use ActiveRecord as a factory but it's not as cool.
|
5
7
|
|
@@ -49,19 +51,17 @@ Run the generator with:
|
|
49
51
|
|
50
52
|
== Resources
|
51
53
|
|
52
|
-
<b>
|
53
|
-
|
54
|
-
<b>Gemcutter</b> for the gem: http://gemcutter.org/gems/pickle
|
54
|
+
<b>GitHub</b> for code: https://github.com/ianwhite/pickle
|
55
55
|
|
56
|
-
<b>
|
56
|
+
<b>RubyGems</b> for the gem: https://rubygems.org/gems/pickle
|
57
57
|
|
58
|
-
<b>
|
58
|
+
<b>RubyDoc.info</b> for docs: http://www.rubydoc.info/github/ianwhite/pickle
|
59
59
|
|
60
|
-
<b>
|
60
|
+
<b>Google Group</b> for questions: https://groups.google.com/group/pickle-cucumber
|
61
61
|
|
62
62
|
<b>Railscast</b> presentation: http://railscasts.com/episodes/186-pickle-with-cucumber
|
63
63
|
|
64
|
-
<b>Blog articles</b>: {
|
64
|
+
<b>Blog articles</b>: {rubyflare: pickle my cucumber}[http://rubyflare.com/2009/10/28/pickle-my-cucumber/]
|
65
65
|
|
66
66
|
|
67
67
|
== Using Pickle
|
@@ -93,12 +93,11 @@ you've written, you can just do stuff like
|
|
93
93
|
Then a user should exist with name: "Fred"
|
94
94
|
And that user should be activated # this uses rspec predicate matchers
|
95
95
|
|
96
|
-
==== Machinist: require your blueprints
|
96
|
+
==== Machinist: require your blueprints
|
97
97
|
|
98
98
|
In your <tt>features/support/env.rb</tt> add the following lines at the bottom
|
99
99
|
|
100
100
|
require "#{Rails.root}/spec/blueprints" # or wherever they live
|
101
|
-
Before { Sham.reset } # reset Shams in between scenarios
|
102
101
|
|
103
102
|
==== FactoryGirl: make sure factories are loaded
|
104
103
|
|
data/Rakefile.d/cucumber.rake
CHANGED
@@ -13,14 +13,15 @@ end
|
|
13
13
|
|
14
14
|
namespace :cucumber do
|
15
15
|
task :setup do
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
sh "
|
20
|
-
sh "echo 'gem \"
|
21
|
-
sh "echo 'gem \"
|
22
|
-
sh "
|
16
|
+
Bundler.with_clean_env do
|
17
|
+
gemfile = "cucumber_test_app/Gemfile"
|
18
|
+
rm_rf "cucumber_test_app"
|
19
|
+
sh "rails new cucumber_test_app --skip-javascript --skip-sprockets"
|
20
|
+
sh "echo 'gem \"cucumber-rails\", :require => false' >> #{gemfile}"
|
21
|
+
sh "echo 'gem \"rspec-rails\", \"~>3.0\"' >> #{gemfile}"
|
22
|
+
sh "echo 'gem \"capybara\"' >> #{gemfile}"
|
23
|
+
sh "bundle install --gemfile=#{gemfile}"
|
24
|
+
sh "ln -s ../../.. cucumber_test_app/vendor/plugins/pickle"
|
23
25
|
end
|
24
|
-
sh "ln -s #{File.expand_path('.')} cucumber_test_app/vendor/plugins/pickle"
|
25
26
|
end
|
26
|
-
end
|
27
|
+
end
|
data/features/app/blueprints.rb
CHANGED
data/features/app/factories.rb
CHANGED
@@ -1,23 +1,25 @@
|
|
1
1
|
# Factories
|
2
2
|
require 'factory_girl'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
FactoryGirl.define do
|
5
|
+
sequence :fork_name do |n|
|
6
|
+
"fork %d04" % n
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
end
|
9
|
+
factory :fork do |f|
|
10
|
+
f.name { FactoryGirl.generate(:fork_name) }
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
13
|
+
factory :tine do |t|
|
14
|
+
t.association :fork
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
end
|
17
|
+
factory :rusty_tine, :class => Tine do |t|
|
18
|
+
t.association :fork
|
19
|
+
t.rusty true
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
factory :fancy_fork, :class => Fork do |t|
|
23
|
+
t.name { "Fancy " + FactoryGirl.generate(:fork_name) }
|
24
|
+
end
|
23
25
|
end
|
@@ -15,7 +15,7 @@ Given(/^all emails? (?:have|has) been delivered$/) do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
Given(/^(\d)+ emails? should be delivered$/) do |count|
|
18
|
-
emails.size.
|
18
|
+
expect(emails.size).to eq(count.to_i)
|
19
19
|
end
|
20
20
|
|
21
21
|
When(/^(?:I|they) follow "([^"]*?)" in #{capture_email}$/) do |link, email_ref|
|
@@ -27,37 +27,37 @@ When(/^(?:I|they) click the first link in #{capture_email}$/) do |email_ref|
|
|
27
27
|
end
|
28
28
|
|
29
29
|
Then(/^(\d)+ emails? should be delivered to (.*)$/) do |count, to|
|
30
|
-
emails("to: \"#{email_for(to)}\"").size.
|
30
|
+
expect(emails("to: \"#{email_for(to)}\"").size).to eq(count.to_i)
|
31
31
|
end
|
32
32
|
|
33
33
|
Then(/^(\d)+ emails? should be delivered with #{capture_fields}$/) do |count, fields|
|
34
|
-
emails(fields).size.
|
34
|
+
expect(emails(fields).size).to eq(count.to_i)
|
35
35
|
end
|
36
36
|
|
37
37
|
Then(/^#{capture_email} should be delivered to (.+)$/) do |email_ref, to|
|
38
|
-
email(email_ref, "to: \"#{email_for(to)}\"").
|
38
|
+
expect(email(email_ref, "to: \"#{email_for(to)}\"")).not_to be_nil
|
39
39
|
end
|
40
40
|
|
41
41
|
Then(/^#{capture_email} should not be delivered to (.+)$/) do |email_ref, to|
|
42
|
-
email(email_ref, "to: \"#{email_for(to)}\"").
|
42
|
+
expect(email(email_ref, "to: \"#{email_for(to)}\"")).to be_nil
|
43
43
|
end
|
44
44
|
|
45
45
|
Then(/^#{capture_email} should have #{capture_fields}$/) do |email_ref, fields|
|
46
|
-
email(email_ref, fields).
|
46
|
+
expect(email(email_ref, fields)).not_to be_nil
|
47
47
|
end
|
48
48
|
|
49
49
|
Then(/^#{capture_email} should contain "(.*)"$/) do |email_ref, text|
|
50
|
-
email(email_ref).body.
|
50
|
+
expect(email(email_ref).body).to match(/#{text}/)
|
51
51
|
end
|
52
52
|
|
53
53
|
Then(/^#{capture_email} should not contain "(.*)"$/) do |email_ref, text|
|
54
|
-
email(email_ref).body.
|
54
|
+
expect(email(email_ref).body).not_to match(/#{text}/)
|
55
55
|
end
|
56
56
|
|
57
57
|
Then(/^#{capture_email} should link to (.+)$/) do |email_ref, page|
|
58
|
-
email(email_ref).body.
|
58
|
+
expect(email(email_ref).body).to match(/#{path_to(page)}/)
|
59
59
|
end
|
60
60
|
|
61
61
|
Then(/^show me the emails?$/) do
|
62
62
|
save_and_open_emails
|
63
|
-
end
|
63
|
+
end
|