pickle 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +3 -2
  3. data/.travis.yml +24 -4
  4. data/History.txt +55 -34
  5. data/README.md +15 -26
  6. data/Rakefile.d/cucumber.rake +13 -4
  7. data/Rakefile.d/repoclean.rake +3 -0
  8. data/features/app/app.rb +7 -7
  9. data/features/app/factories.rb +5 -5
  10. data/features/email/email.feature +1 -0
  11. data/features/step_definitions/email_steps.rb +1 -0
  12. data/features/step_definitions/extra_email_steps.rb +5 -5
  13. data/features/step_definitions/pickle_steps.rb +1 -0
  14. data/features/support/email.rb +1 -0
  15. data/features/support/env.rb +9 -3
  16. data/features/support/pickle.rb +2 -2
  17. data/gemfiles/Gemfile-rails.5.0.x +12 -0
  18. data/gemfiles/Gemfile-rails.5.1.x +10 -0
  19. data/gemfiles/Gemfile-rails.5.2.x +11 -0
  20. data/gemfiles/Gemfile-rails.5.2.x-cukes-4 +11 -0
  21. data/gemfiles/Gemfile-rails.5.2.x-cukes-5 +12 -0
  22. data/gemfiles/Gemfile-rails.6.0.x +10 -0
  23. data/gemfiles/Gemfile-rails.6.0.x-cukes-5 +11 -0
  24. data/gemfiles/Gemfile-rails.edge +9 -0
  25. data/lib/pickle.rb +0 -1
  26. data/lib/pickle/adapter.rb +9 -11
  27. data/lib/pickle/config.rb +1 -1
  28. data/lib/pickle/path.rb +1 -1
  29. data/lib/pickle/session.rb +15 -18
  30. data/lib/pickle/session/parser.rb +11 -9
  31. data/lib/pickle/version.rb +1 -1
  32. data/pickle.gemspec +9 -8
  33. data/rails_generators/pickle/templates/pickle.rb +2 -2
  34. data/spec/pickle/adapter_spec.rb +19 -19
  35. data/spec/pickle/config_spec.rb +9 -9
  36. data/spec/pickle/email_spec.rb +1 -1
  37. data/spec/pickle/path_spec.rb +37 -18
  38. data/spec/pickle/session_spec.rb +5 -5
  39. data/spec/spec_helper.rb +6 -1
  40. metadata +52 -56
  41. data/Gemfile +0 -3
  42. data/Gemfile.lock.development +0 -158
  43. data/features/step_definitions/email_steps.rb +0 -65
  44. data/features/step_definitions/pickle_steps.rb +0 -105
  45. data/features/support/email.rb +0 -21
  46. data/init.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 539f558a14741424c0a8da2e4a9aee5c0eae8acf
4
- data.tar.gz: b57e316aa5dbc009cb4ed513ffe0bdfa294cb0a4
2
+ SHA256:
3
+ metadata.gz: 65a9850f97ef599bceb024b95fba2c35df30afe28c1beb85941bcff6e8bc6172
4
+ data.tar.gz: 6961363fcf4132b185f989fb74ae21323da46663b144a52035579566dc05aba9
5
5
  SHA512:
6
- metadata.gz: 8f9bb9f3e62e16bd4d55c63a9fa41752cc341b522a7b3805fb9ede47b2fafb7c10ba6171c8c691ef530c615bfa4a9d6f91e1ee6c879d0e374fdf5ef21c0d1ad1
7
- data.tar.gz: ee37511e749bd0eb4f42e8801e7188051f36ea990207efdb7924dacb14973162a78188afd1d0da68e2b21aade94ae1e0c0b67d65aa3a39b36ce698bda1b4c31b
6
+ metadata.gz: df190d3264baa28df348f75672c04a001a442bb12fbe685fb0ee734dbf406cdb8af236b1186fb1be1c7fa74eb2f7b8240a1acf34075f3801f3ff9ac4b706230b
7
+ data.tar.gz: 4dd1896f3d92d99f90e675bd9b036b6cebdc6154defa127fd95aec9570e30f82753b52d66d9a9d3ef688e144f8420ff515caf70e0637bad3305cfa570a2817fb
data/.gitignore CHANGED
@@ -4,7 +4,6 @@
4
4
  # local ruby/gems dev stuff
5
5
  .rvmrc
6
6
  .bundle
7
- Gemfile.lock
8
7
  cucumber_test_app
9
8
  pickle-email*
10
9
 
@@ -14,4 +13,6 @@ doc
14
13
 
15
14
  # built gems
16
15
  pkg
17
- *.gem
16
+ *.gem
17
+
18
+ gemfiles/*.lock
@@ -1,10 +1,30 @@
1
1
  language: ruby
2
+ dist: xenial
3
+ cache: bundler
2
4
  rvm:
3
- - 2.1.1
4
- - 2.0.0
5
+ #- 2.7.1
6
+ - 2.6.6
7
+ - 2.5.8
8
+ #- ruby-head
9
+ gemfile:
10
+ - gemfiles/Gemfile-rails.5.0.x
11
+ - gemfiles/Gemfile-rails.5.1.x
12
+ - gemfiles/Gemfile-rails.5.2.x
13
+ - gemfiles/Gemfile-rails.5.2.x-cukes-4
14
+ - gemfiles/Gemfile-rails.5.2.x-cukes-5
15
+ - gemfiles/Gemfile-rails.6.0.x
16
+ - gemfiles/Gemfile-rails.6.0.x-cukes-5
17
+ #- gemfiles/Gemfile-rails.edge
18
+ matrix:
19
+ allow_failures:
20
+ - rvm: ruby-head
21
+ - rvm: 2.7.1
22
+ - gemfile: gemfiles/Gemfile-rails.edge
23
+ - gemfile: gemfiles/Gemfile-rails.5.2.x-cukes-5
24
+ - gemfile: gemfiles/Gemfile-rails.6.0.x-cukes-5
25
+ fast_finish: true
5
26
 
6
- before_install:
7
- - cp Gemfile.lock.development Gemfile.lock
8
27
  script:
28
+ - gem install bundler
9
29
  - bundle exec rake spec
10
30
  - bundle exec rake cucumber
@@ -1,3 +1,24 @@
1
+ == 0.6.0
2
+ * Drop support for cucumber < 3
3
+ * Officially support cucumber 4.1
4
+ * Relax dependency to support cucumber 5.x although not officially supported
5
+ * Run tests for Rails 5.0, 5.1, 5.2 and 6.0
6
+
7
+ == 0.5.5
8
+ * Relax dependency on cucumber to allow usage with Rails 5.2 [Yohei Kitamura]
9
+
10
+ == 0.5.4
11
+ * updated FactoryGirl to FactoryBot [Blake McDaniel]
12
+
13
+ == 0.5.3
14
+ * small fix to pickle_path_for_resources_action_segment [Tema Bolshakov]
15
+ * update for fabrication adapter with protected method klass [Liam Krewer]
16
+ * Fix tests to run on travis again and codecoverage [Mathieu Jobin]
17
+
18
+ == 0.5.2
19
+ * replace alias_method_chain by Module#prepend [Mathieu Jobin]
20
+ eliminating deprecation warnings when using with Rails 5
21
+
1
22
  == 0.5.1
2
23
 
3
24
  * Add support to use Factory.build [Erik Peterson]
@@ -29,7 +50,7 @@
29
50
 
30
51
  * 1 bugfix
31
52
  * Don't blow up when fabrication not present [Ian White]
32
-
53
+
33
54
 
34
55
  == 0.4.9
35
56
 
@@ -38,8 +59,8 @@
38
59
 
39
60
  * 1 minor improvement
40
61
  * Update development dependencies so tests/features run on rails 3.1 and friends
41
-
42
-
62
+
63
+
43
64
  == 0.4.8
44
65
 
45
66
  * 2 minor improvements
@@ -52,7 +73,7 @@
52
73
  * 2 minor improvements
53
74
  * Better error message for failing to find a model [Ian White, reported by Yuval Karmi]
54
75
  * dev deps updated to latest cucumber & cucumber-rails [Ian White]
55
-
76
+
56
77
 
57
78
  == 0.4.6
58
79
  Documentation updates
@@ -75,7 +96,7 @@ large object space fix, and allow escaped quotes as string values
75
96
  * 1 bugfix
76
97
  * When using super-huge GC limits (for speeding up tests), occasionally we'll see abandoned Mongoid::Document classes appear in the ObjectSpace.
77
98
  This patch should fix that. [Devin Walters and Nick Karpenske]
78
-
99
+
79
100
  * 1 improvement
80
101
  * allow escaped quotes (\") in quoted fields [Jonathan Hinkle]
81
102
 
@@ -99,7 +120,7 @@ Docfix
99
120
 
100
121
  * 1 improvement
101
122
  * documentation fixes, and example of writing your own pickle steps
102
-
123
+
103
124
 
104
125
  == 0.4.0
105
126
  Mongoid adapter, fallback ORM adapter for those not using machinist or active_record, bugfixes
@@ -107,9 +128,9 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
107
128
  * 2 major improvements
108
129
  * adapter for Mongoid [Sebastian Zuchmanski]
109
130
  * replace ActiveRecord 'factory' adapter with Orm adapter.
110
-
131
+
111
132
  If you don't have machinist or factory_girl, the Orm factory adapter will fallback to your Orm to create classes.
112
-
133
+
113
134
  BC: if you have a line like this:
114
135
  Pickle.configure do |config|
115
136
  config.adapters = [:active_record]
@@ -119,10 +140,10 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
119
140
  Pickle.configure do |config|
120
141
  config.adapters = [:orm]
121
142
  end
122
-
143
+
123
144
  * 1 minor improvement
124
145
  * Pickle::Session::ModelNotKnownError is raised instead of a generic RuntimeError
125
-
146
+
126
147
  * 1 bugfix
127
148
  * references to unknown models in fields now raise ModelNotKnownError instead of silently assigning nil
128
149
 
@@ -136,7 +157,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
136
157
 
137
158
  * 1 bugfix
138
159
  * find_models now works with a factory name with spaces in it [#27]
139
-
160
+
140
161
 
141
162
  == 0.3.4
142
163
 
@@ -149,7 +170,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
149
170
 
150
171
  * 1 minor improvement
151
172
  * Pickle respects the default build strategy for factory girl. [Sean Hussey]
152
-
173
+
153
174
 
154
175
  == 0.3.2
155
176
 
@@ -182,7 +203,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
182
203
  == 0.2.11
183
204
 
184
205
  * 1 improvement
185
- * use correct type when converting STI pickle model to attributes
206
+ * use correct type when converting STI pickle model to attributes
186
207
 
187
208
 
188
209
  == 0.2.10
@@ -219,8 +240,8 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
219
240
  * 2 improvements
220
241
  * running specs is now doable without being in a rails app - just do 'rake spec'
221
242
  * running features is more straightforward, 'rake cucumber' then follow the instructions
222
-
223
-
243
+
244
+
224
245
  == 0.2.5 - 17 Mar 2010
225
246
 
226
247
  * 2 improvements
@@ -245,7 +266,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
245
266
  | user | name | status |
246
267
  | jack | Jack Spratt | alone |
247
268
  | pete | Pete Sprong | dead |
248
-
269
+
249
270
  * 1 minor improvement
250
271
  * Fix bug in error message for when pickle ref can't be found [Myron Marston]
251
272
 
@@ -256,8 +277,8 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
256
277
  * Added ability to follow links in emails (see email_steps.rb) [Michael Moen]
257
278
  * Added a step definition for doing stuff like: Then the user's name should be "Tobi" [Tobi Knaup]
258
279
  * Docfixes, mostly about testing [Nicholas Rutherford]
259
-
260
-
280
+
281
+
261
282
  == 0.2.1 - 1 Dec 2009
262
283
 
263
284
  * 2 minor improvements
@@ -276,11 +297,11 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
276
297
  | Ethel |
277
298
  And the 1st user should be male
278
299
  And the 2nd user should be female
279
-
300
+
280
301
  * tables now support pickle refs in cells (see features/pickle/create_from_factory_girl.rb#37)
281
-
302
+
282
303
  * features/support/email.rb adds an email helper for mapping names to email addresses (similar to NavigationHelper in paths.rb)
283
-
304
+
284
305
  * Added ability for path_to_pickle to handle arbitrary segments
285
306
  Example:
286
307
  path_to_pickle('account', 'the enquiry') => account_enquiry_path(<enquiry>)
@@ -305,7 +326,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
305
326
 
306
327
  * 1 minor improvement
307
328
  * docs: more links
308
-
329
+
309
330
 
310
331
  == 0.1.22 - 7 Nov 2009
311
332
 
@@ -330,7 +351,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
330
351
 
331
352
  * 1 minor enhancement
332
353
  * Add support for Cucumber tables [Tobi Knaup]
333
-
354
+
334
355
 
335
356
  == 0.1.16, 0.1.17, 0.1.18 - 13 Oct 2009
336
357
 
@@ -350,7 +371,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
350
371
  * update specs and features for latest cucumber and machinist changes
351
372
 
352
373
 
353
- == 0.1.13 - 16 June 2009
374
+ == 0.1.13 - 16 June 2009
354
375
 
355
376
  * 2 minor enhancements
356
377
  * model! and created_model! raise an error if pickle name can't be found
@@ -368,7 +389,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
368
389
 
369
390
  * 2 minor enhancements
370
391
  * Pickle now supports multiple machinist blueprints
371
- * Fix confusing adapter/adaptor comment generator comment
392
+ * Fix confusing adapter/adaptor comment generator comment
372
393
 
373
394
 
374
395
  == 0.1.10 - 13 Feb 2009
@@ -399,7 +420,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
399
420
  * 2 API changes
400
421
  * script/generate pickle path[s] now amends the features/support/paths.rb file
401
422
  instead of creating pge_to_path and path_steps.
402
-
423
+
403
424
  * pickle_email_steps is renamed email_steps
404
425
 
405
426
 
@@ -413,22 +434,22 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
413
434
 
414
435
  * generate email steps with `script/generate pickle email`
415
436
  email steps allow you to do things like this:
416
-
437
+
417
438
  Then 2 emails should be delivered
418
439
  And the first email should be delivered to fred@gmail.com
419
440
  And the 2nd email should be delivered to the user: "ethel"
420
-
441
+
421
442
  Then 1 email should be delivered with subject: "Activate your account"
422
443
  And the email should link to the user's page
423
-
444
+
424
445
  take a look at features/step_definitions/pickle_email_steps.rb
425
-
446
+
426
447
  * generate path steps with `script/generate pickle path`
427
448
  path steps allow you to do things like this
428
-
449
+
429
450
  When I go to the comment's page
430
451
  Then I should be at the user's new comment page
431
-
452
+
432
453
  take a look at features/step_definitions/pickle_path_steps.rb, and modify page_to_path to suit your needs
433
454
 
434
455
  * 4 minor enhancements
@@ -453,7 +474,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
453
474
  for much more intuitive env.rb
454
475
 
455
476
  * 2 minor enhancement
456
- * predicate matching is less prone to step conflicts because we preload a
477
+ * predicate matching is less prone to step conflicts because we preload a
457
478
  big list of all the predicate and column methods
458
479
  * field values now handle booleans and numerics
459
480
 
@@ -479,7 +500,7 @@ Mongoid adapter, fallback ORM adapter for those not using machinist or active_re
479
500
  * 2 major enhancements
480
501
  * create your pickle steps with script/generate pickle
481
502
  * Adapter based architecture, supports Machinist, FactoryGirl, and vanilla ActiveRecord
482
-
503
+
483
504
  * 1 minor enhancement
484
505
  * model_names now defaults to subclasses of AR::Base
485
506
  * #original_model => #created_model
data/README.md CHANGED
@@ -10,7 +10,16 @@ References to the models are stored in the current world, not necessarily for th
10
10
 
11
11
  This is a quickstart guide for rails apps. Firstly, install [cucumber-rails](http://github.com/aslakhellesoy/cucumber-rails), and its dependencies. Then do the following:
12
12
 
13
- ### Rails 3:
13
+ ## Supported versions
14
+
15
+ Rails 4.2 should still work, but it is unsupported. There is a conflict with bundler on travis I just don't want to deal
16
+ with. Since this is no longer supported by the rails team, consider using it at you own risk.
17
+
18
+ Cucumber 2.x support is dropped from release 0.6.0
19
+ Cucumber 3.x and 4.x should work with all Rails 5.x versions
20
+ Cucumber 5.x support is planned
21
+
22
+ ### Rails 5 and Rails 6
14
23
 
15
24
  Add the gem to your Gemfile:
16
25
 
@@ -36,26 +45,6 @@ Run the generator, e.g:
36
45
  rails g pickle --paths --email
37
46
  ```
38
47
 
39
- ### For Rails 2:
40
-
41
- Add the following to config/environments/cucumber:
42
-
43
- ```ruby
44
- config.gem 'pickle'
45
- ```
46
-
47
- Install the gem with
48
-
49
- ```shell
50
- rake gems:install RAILS_ENV=cucumber
51
- ```
52
-
53
- Run the generator with:
54
-
55
- ```ruby
56
- script/generate pickle [paths] [email]
57
- ```
58
-
59
48
  ## Resources
60
49
 
61
50
  **GitHub** for code: https://github.com/ianwhite/pickle
@@ -88,7 +77,7 @@ Given a post exists with title: "My Post", body: "My body"
88
77
 
89
78
  ### Using with factory-girl or machinist
90
79
 
91
- But you're using Machinist or FactoryGirl right?! To leverage all of the factories/blueprints you've written, you can just do stuff like
80
+ But you're using Machinist or FactoryBot right?! To leverage all of the factories/blueprints you've written, you can just do stuff like
92
81
 
93
82
  ```gherkin
94
83
  Given a user exists
@@ -107,14 +96,14 @@ In your `features/support/env.rb` add the following lines at the bottom
107
96
  require "#{Rails.root}/spec/blueprints" # or wherever they live
108
97
  ```
109
98
 
110
- #### FactoryGirl: make sure factories are loaded
99
+ #### FactoryBot: make sure factories are loaded
111
100
 
112
101
  In your config/environments/cucumber.rb file, make sure the factory-girl gem is included (unless it's installed as a plugin).
113
102
 
114
- If that doesn't solve loading issues then require your factories.rb file directly in a file called 'features/support/factory_girl.rb'
103
+ If that doesn't solve loading issues then require your factories.rb file directly in a file called 'features/support/factory_bot.rb'
115
104
 
116
105
  ```ruby
117
- # example features/support/factory_girl.rb
106
+ # example features/support/factory_bot.rb
118
107
  require File.dirname(__FILE__) + '/../../spec/factories'
119
108
  ```
120
109
 
@@ -174,7 +163,7 @@ Given a user exists with name: "Fred"
174
163
  Given a user exists with name: "Fred", activated: false
175
164
  ```
176
165
 
177
- This last step could be better expressed by using Machinist/FactoryGirl to create an activated user. Then you can do
166
+ This last step could be better expressed by using Machinist/FactoryBot to create an activated user. Then you can do
178
167
 
179
168
  ```gherkin
180
169
  Given an activated user exists with name: "Fred"
@@ -2,7 +2,7 @@ require 'cucumber/rake/task'
2
2
 
3
3
  desc "Run features"
4
4
  Cucumber::Rake::Task.new(:cucumber => [:cucumber_test_app]) do |t|
5
- t.cucumber_opts = ['--format', 'pretty', '--require', 'features']
5
+ t.cucumber_opts = %w[--format pretty --require features -t] + ["'not @wip'"]
6
6
  end
7
7
 
8
8
  desc "setup a rails app for running cucumber"
@@ -13,15 +13,24 @@ end
13
13
 
14
14
  namespace :cucumber do
15
15
  task :setup do
16
+ current_gemfile = ENV['BUNDLE_GEMFILE']
17
+ sh "BUNDLE_GEMFILE=#{current_gemfile} bundle show cucumber > /tmp/cukes_version"
18
+ sh "BUNDLE_GEMFILE=#{current_gemfile} bundle show sqlite3 > /tmp/sqlite_version"
19
+ cukes_version=File.read('/tmp/cukes_version').split('-').last.chomp
20
+ sqlite_version=File.read('/tmp/sqlite_version').split('-').last.chomp
21
+ puts "Versions: Cucumber #{cukes_version}, SQLite #{sqlite_version}."
16
22
  Bundler.with_clean_env do
17
23
  gemfile = "cucumber_test_app/Gemfile"
18
24
  rm_rf "cucumber_test_app"
19
- sh "rails new cucumber_test_app --skip-javascript --skip-sprockets"
25
+ sh "BUNDLE_GEMFILE=#{current_gemfile} bundle exec rails new cucumber_test_app --skip-spring --skip-javascript --skip-sprockets --skip-bootsnap"
26
+ sh "echo 'gem \"cucumber\", \"~> #{cukes_version}\", :require => false' >> #{gemfile}"
27
+ sh "sed -i 's/gem .sqlite3./gem \"sqlite3\", \"~> #{sqlite_version}\"/' #{gemfile}"
28
+ sh "cat #{gemfile} | grep sqli"
20
29
  sh "echo 'gem \"cucumber-rails\", :require => false' >> #{gemfile}"
21
30
  sh "echo 'gem \"rspec-rails\", \"~>3.0\"' >> #{gemfile}"
22
- sh "echo 'gem \"capybara\"' >> #{gemfile}"
31
+ sh "echo 'gem \"pickle\", path: \"#{__dir__}/..\"' >> #{gemfile}"
23
32
  sh "bundle install --gemfile=#{gemfile}"
24
- sh "ln -s ../../.. cucumber_test_app/vendor/plugins/pickle"
33
+ sh "(cd cucumber_test_app ; bundle exec rake db:migrate)"
25
34
  end
26
35
  end
27
36
  end
@@ -0,0 +1,3 @@
1
+ task :repoclean do
2
+ system "rm -fr pickle-email-* .bundle/ .yardoc/ cucumber_test_app/ doc/ tmp"
3
+ end
@@ -90,19 +90,19 @@ end
90
90
  # controllers
91
91
  class DefaultController < ActionController::Base
92
92
  def index
93
- render :text => "index: I was invoked with #{request.path}"
93
+ render :plain => "index: I was invoked with #{request.path}"
94
94
  end
95
-
95
+
96
96
  def show
97
- render :text => "show: I was invoked with #{request.path}"
97
+ render :plain => "show: I was invoked with #{request.path}"
98
98
  end
99
-
99
+
100
100
  def new
101
- render :text => "new: I was invoked with #{request.path}"
101
+ render :plain => "new: I was invoked with #{request.path}"
102
102
  end
103
-
103
+
104
104
  def edit
105
- render :text => "edit: I was invoked with #{request.path}"
105
+ render :plain => "edit: I was invoked with #{request.path}"
106
106
  end
107
107
  end
108
108