pickle 0.4.11 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.1
4
+ - 2.0.0
5
+
6
+ before_install:
7
+ - cp Gemfile.lock.development Gemfile.lock
8
+ script:
9
+ - bundle exec rake spec
10
+ - bundle exec rake cucumber
@@ -8,140 +8,137 @@ PATH
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
- actionmailer (3.1.4)
12
- actionpack (= 3.1.4)
13
- mail (~> 2.3.0)
14
- actionpack (3.1.4)
15
- activemodel (= 3.1.4)
16
- activesupport (= 3.1.4)
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.1)
21
+ rack-cache (~> 1.2)
22
22
  rack-mount (~> 0.8.2)
23
23
  rack-test (~> 0.6.1)
24
- sprockets (~> 2.0.3)
25
- activemodel (3.1.4)
26
- activesupport (= 3.1.4)
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.4)
30
- activemodel (= 3.1.4)
31
- activesupport (= 3.1.4)
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.4)
35
- activemodel (= 3.1.4)
36
- activesupport (= 3.1.4)
37
- activesupport (3.1.4)
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.0)
41
- capybara (1.1.2)
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
- selenium-webdriver (~> 2.0)
47
- xpath (~> 0.1.4)
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.2)
53
- gherkin (~> 2.9.0)
54
- json (>= 1.4.6)
55
- term-ansicolor (>= 1.0.6)
56
- cucumber-rails (1.3.0)
57
- capybara (>= 1.1.2)
58
- cucumber (>= 1.1.8)
59
- nokogiri (>= 1.5.0)
60
- database_cleaner (0.7.2)
61
- diff-lcs (1.1.3)
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 (1.3.2)
64
- factory_girl (3.0.0)
62
+ fabrication (2.11.3)
63
+ factory_girl (4.4.0)
65
64
  activesupport (>= 3.0.0)
66
- ffi (1.0.11)
67
- gherkin (2.9.1)
68
- json (>= 1.4.6)
69
- git (1.2.5)
70
- hike (1.2.1)
71
- i18n (0.6.0)
72
- json (1.6.5)
73
- machinist (1.0.6)
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.18)
79
- multi_json (1.1.0)
80
- nokogiri (1.5.2)
81
- polyglot (0.3.3)
82
- rack (1.3.6)
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.2)
88
+ rack-ssl (1.3.4)
88
89
  rack
89
- rack-test (0.6.1)
90
+ rack-test (0.6.2)
90
91
  rack (>= 1.0)
91
- rails (3.1.4)
92
- actionmailer (= 3.1.4)
93
- actionpack (= 3.1.4)
94
- activerecord (= 3.1.4)
95
- activeresource (= 3.1.4)
96
- activesupport (= 3.1.4)
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.4)
99
- railties (3.1.4)
100
- actionpack (= 3.1.4)
101
- activesupport (= 3.1.4)
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 (0.9.2.2)
107
- rdoc (3.12)
107
+ rake (10.3.2)
108
+ rdoc (3.12.2)
108
109
  json (~> 1.4)
109
- rspec (2.6.0)
110
- rspec-core (~> 2.6.0)
111
- rspec-expectations (~> 2.6.0)
112
- rspec-mocks (~> 2.6.0)
113
- rspec-core (2.6.4)
114
- rspec-expectations (2.6.0)
115
- diff-lcs (~> 1.1.2)
116
- rspec-mocks (2.6.0)
117
- rspec-rails (2.6.1)
118
- actionpack (~> 3.0)
119
- activesupport (~> 3.0)
120
- railties (~> 3.0)
121
- rspec (~> 2.6.0)
122
- rubyzip (0.9.6.1)
123
- selenium-webdriver (2.20.0)
124
- childprocess (>= 0.2.5)
125
- ffi (~> 1.0)
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.5)
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.3.3)
138
- treetop (1.4.10)
134
+ tilt (1.4.1)
135
+ treetop (1.4.15)
139
136
  polyglot
140
137
  polyglot (>= 0.3.1)
141
- tzinfo (0.3.32)
142
- xpath (0.1.4)
138
+ tzinfo (0.3.41)
139
+ xpath (2.0.0)
143
140
  nokogiri (~> 1.3)
144
- yard (0.7.5)
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 (~> 2.6.0)
158
+ rspec-rails (~> 3.0)
162
159
  sqlite3-ruby
163
160
  yard
@@ -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
@@ -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>Github</b> for code: http://github.com/ianwhite/pickle
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>Rdoc.info</b> for docs: http://rdoc.info/projects/ianwhite/pickle
56
+ <b>RubyGems</b> for the gem: https://rubygems.org/gems/pickle
57
57
 
58
- <b>Google group</b> for questions: http://groups.google.com/group/pickle-cucumber
58
+ <b>RubyDoc.info</b> for docs: http://www.rubydoc.info/github/ianwhite/pickle
59
59
 
60
- <b>Lighthouse</b> for bugs: http://ianwhite.lighthouseapp.com/projects/25941-pickle
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>: {dynamic50: Integration testing with cucumber and pickle}[http://blog.dynamic50.com/index.php/2009/04/integration-testing-with-cucumber-and-pickle/], {rubyflare: pickle my cucumber}[http://rubyflare.com/2009/10/28/pickle-my-cucumber/]
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 and reset Shams
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
 
@@ -13,14 +13,15 @@ end
13
13
 
14
14
  namespace :cucumber do
15
15
  task :setup do
16
- rm_rf "cucumber_test_app"
17
- sh "rails new cucumber_test_app"
18
- cd "cucumber_test_app" do
19
- sh "echo 'gem \"cucumber-rails\"' >> Gemfile"
20
- sh "echo 'gem \"rspec-rails\"' >> Gemfile"
21
- sh "echo 'gem \"capybara\"' >> Gemfile"
22
- sh "bundle install"
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
@@ -1,11 +1,6 @@
1
1
  # Blueprints
2
2
  require 'machinist/active_record'
3
3
 
4
- Sham.spoon_name { |i| "Spoon #{i}" }
5
-
6
4
  Spoon.blueprint do
7
- name { Sham.spoon_name }
5
+ name { "A Spoon" }
8
6
  end
9
-
10
- # reset shams between scenarios
11
- Before { Sham.reset }
@@ -1,23 +1,25 @@
1
1
  # Factories
2
2
  require 'factory_girl'
3
3
 
4
- Factory.sequence :fork_name do |n|
5
- "fork %d04" % n
6
- end
4
+ FactoryGirl.define do
5
+ sequence :fork_name do |n|
6
+ "fork %d04" % n
7
+ end
7
8
 
8
- Factory.define :fork do |f|
9
- f.name { Factory.next(:fork_name) }
10
- end
9
+ factory :fork do |f|
10
+ f.name { FactoryGirl.generate(:fork_name) }
11
+ end
11
12
 
12
- Factory.define :tine do |t|
13
- t.association :fork
14
- end
13
+ factory :tine do |t|
14
+ t.association :fork
15
+ end
15
16
 
16
- Factory.define :rusty_tine, :class => Tine do |t|
17
- t.association :fork
18
- t.rusty true
19
- end
17
+ factory :rusty_tine, :class => Tine do |t|
18
+ t.association :fork
19
+ t.rusty true
20
+ end
20
21
 
21
- Factory.define :fancy_fork, :class => Fork do |t|
22
- t.name { "Fancy " + Factory.next(:fork_name) }
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.should == count.to_i
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.should == count.to_i
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.should == count.to_i
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)}\"").should_not be_nil
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)}\"").should be_nil
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).should_not be_nil
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.should =~ /#{text}/
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.should_not =~ /#{text}/
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.should =~ /#{path_to(page)}/
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