pickle 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b58eef50218f9337a561a6bb1037202cc200fc2a
4
- data.tar.gz: 4ef8f88b81920ea1e5297a10dc1407d61f4cba71
3
+ metadata.gz: 7e7168521d6d499e30be9d1fec65880ef854e0e9
4
+ data.tar.gz: 8708853820e50391f50f23ce5bb07fec56b3edc4
5
5
  SHA512:
6
- metadata.gz: 0dd3d6376c5c8d7372935fc15d451e69c975155461003679e7bdfc6e82bb31775d3fb112eb2d7c2f4eb415591aa50b10ba72028ce68f3f9e4077ef63bda1d9d5
7
- data.tar.gz: cece36b98a29a5b44c3751f6a592cbf8a2cca0d48e25f97e8ca97d599a55f689a310b1b94288da2cf5d89a193a58860a75aefba7dc5d6f673bd6d0087a9f890b
6
+ metadata.gz: 0cae7674d31fbba4431d990edc9c179159a3036725df417898d55197941a4b81edf65ca7125f85c622c35527cbac0d7aafbbe39c9942037d4dc88916fe117d0d
7
+ data.tar.gz: d247e0339a2254ab3c377160162213ff83c26f077cae65cef833ba67113eb44968e04c380e2d52f1e0642961d498c2cdbbbe27615ef3339146b8e3a7f78b43da
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,4 @@ doc
14
13
 
15
14
  # built gems
16
15
  pkg
17
- *.gem
16
+ *.gem
@@ -1,10 +1,17 @@
1
1
  language: ruby
2
+ dist: xenial
3
+ cache: bundler
2
4
  rvm:
3
- - 2.1.1
4
- - 2.0.0
5
+ - 2.4.1
6
+ - 2.3.4
7
+ - 2.2.7
8
+ - 2.1.10
9
+ matrix:
10
+ allow_failures:
11
+ - rvm: 2.1.10
12
+ fast_finish: true
5
13
 
6
- before_install:
7
- - cp Gemfile.lock.development Gemfile.lock
8
14
  script:
15
+ - gem install bundler
9
16
  - bundle exec rake spec
10
17
  - bundle exec rake cucumber
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ # Bundler 1.x default to insecure http:// for github: shortcut
4
+ git_source(:github){ |repo_name| "https://github.com/#{repo_name}.git" }
5
+
3
6
  gemspec
7
+ gem 'fabrication', github: 'mathieujobin/fabrication', ref: '923cf6fcefd0566b1d6be7bd2f685b89388f4800'
@@ -0,0 +1,201 @@
1
+ GIT
2
+ remote: https://github.com/mathieujobin/fabrication.git
3
+ revision: 923cf6fcefd0566b1d6be7bd2f685b89388f4800
4
+ ref: 923cf6fcefd0566b1d6be7bd2f685b89388f4800
5
+ specs:
6
+ fabrication (2.16.2)
7
+
8
+ PATH
9
+ remote: .
10
+ specs:
11
+ pickle (0.5.4)
12
+ cucumber (>= 0.8, < 3.0)
13
+ rake
14
+
15
+ GEM
16
+ remote: http://rubygems.org/
17
+ specs:
18
+ actionmailer (4.2.9)
19
+ actionpack (= 4.2.9)
20
+ actionview (= 4.2.9)
21
+ activejob (= 4.2.9)
22
+ mail (~> 2.5, >= 2.5.4)
23
+ rails-dom-testing (~> 1.0, >= 1.0.5)
24
+ actionpack (4.2.9)
25
+ actionview (= 4.2.9)
26
+ activesupport (= 4.2.9)
27
+ rack (~> 1.6)
28
+ rack-test (~> 0.6.2)
29
+ rails-dom-testing (~> 1.0, >= 1.0.5)
30
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
31
+ actionview (4.2.9)
32
+ activesupport (= 4.2.9)
33
+ builder (~> 3.1)
34
+ erubis (~> 2.7.0)
35
+ rails-dom-testing (~> 1.0, >= 1.0.5)
36
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
37
+ activejob (4.2.9)
38
+ activesupport (= 4.2.9)
39
+ globalid (>= 0.3.0)
40
+ activemodel (4.2.9)
41
+ activesupport (= 4.2.9)
42
+ builder (~> 3.1)
43
+ activerecord (4.2.9)
44
+ activemodel (= 4.2.9)
45
+ activesupport (= 4.2.9)
46
+ arel (~> 6.0)
47
+ activesupport (4.2.9)
48
+ i18n (~> 0.7)
49
+ minitest (~> 5.1)
50
+ thread_safe (~> 0.3, >= 0.3.4)
51
+ tzinfo (~> 1.1)
52
+ addressable (2.5.1)
53
+ public_suffix (~> 2.0, >= 2.0.2)
54
+ arel (6.0.4)
55
+ builder (3.2.3)
56
+ capybara (2.15.1)
57
+ addressable
58
+ mini_mime (>= 0.1.3)
59
+ nokogiri (>= 1.3.3)
60
+ rack (>= 1.0.0)
61
+ rack-test (>= 0.5.4)
62
+ xpath (~> 2.0)
63
+ codecov (0.1.10)
64
+ json
65
+ simplecov
66
+ url
67
+ concurrent-ruby (1.0.5)
68
+ cucumber (2.4.0)
69
+ builder (>= 2.1.2)
70
+ cucumber-core (~> 1.5.0)
71
+ cucumber-wire (~> 0.0.1)
72
+ diff-lcs (>= 1.1.3)
73
+ gherkin (~> 4.0)
74
+ multi_json (>= 1.7.5, < 2.0)
75
+ multi_test (>= 0.1.2)
76
+ cucumber-core (1.5.0)
77
+ gherkin (~> 4.0)
78
+ cucumber-rails (1.5.0)
79
+ capybara (>= 1.1.2, < 3)
80
+ cucumber (>= 1.3.8, < 4)
81
+ mime-types (>= 1.17, < 4)
82
+ nokogiri (~> 1.5)
83
+ railties (>= 4, < 5.2)
84
+ cucumber-wire (0.0.1)
85
+ database_cleaner (1.6.1)
86
+ diff-lcs (1.3)
87
+ docile (1.1.5)
88
+ erubis (2.7.0)
89
+ factory_bot (4.8.2)
90
+ activesupport (>= 3.0.0)
91
+ gherkin (4.1.3)
92
+ git (1.3.0)
93
+ globalid (0.4.0)
94
+ activesupport (>= 4.2.0)
95
+ i18n (0.8.6)
96
+ json (2.1.0)
97
+ loofah (2.0.3)
98
+ nokogiri (>= 1.5.9)
99
+ machinist (2.0)
100
+ mail (2.6.6)
101
+ mime-types (>= 1.16, < 4)
102
+ mime-types (3.1)
103
+ mime-types-data (~> 3.2015)
104
+ mime-types-data (3.2016.0521)
105
+ mini_mime (0.1.4)
106
+ mini_portile2 (2.2.0)
107
+ minitest (5.10.3)
108
+ multi_json (1.12.1)
109
+ multi_test (0.1.2)
110
+ nokogiri (1.8.0)
111
+ mini_portile2 (~> 2.2.0)
112
+ public_suffix (2.0.5)
113
+ rack (1.6.8)
114
+ rack-test (0.6.3)
115
+ rack (>= 1.0)
116
+ rails (4.2.9)
117
+ actionmailer (= 4.2.9)
118
+ actionpack (= 4.2.9)
119
+ actionview (= 4.2.9)
120
+ activejob (= 4.2.9)
121
+ activemodel (= 4.2.9)
122
+ activerecord (= 4.2.9)
123
+ activesupport (= 4.2.9)
124
+ bundler (>= 1.3.0, < 2.0)
125
+ railties (= 4.2.9)
126
+ sprockets-rails
127
+ rails-deprecated_sanitizer (1.0.3)
128
+ activesupport (>= 4.2.0.alpha)
129
+ rails-dom-testing (1.0.8)
130
+ activesupport (>= 4.2.0.beta, < 5.0)
131
+ nokogiri (~> 1.6)
132
+ rails-deprecated_sanitizer (>= 1.0.1)
133
+ rails-html-sanitizer (1.0.3)
134
+ loofah (~> 2.0)
135
+ railties (4.2.9)
136
+ actionpack (= 4.2.9)
137
+ activesupport (= 4.2.9)
138
+ rake (>= 0.8.7)
139
+ thor (>= 0.18.1, < 2.0)
140
+ rake (12.0.0)
141
+ rspec-core (3.6.0)
142
+ rspec-support (~> 3.6.0)
143
+ rspec-expectations (3.6.0)
144
+ diff-lcs (>= 1.2.0, < 2.0)
145
+ rspec-support (~> 3.6.0)
146
+ rspec-mocks (3.6.0)
147
+ diff-lcs (>= 1.2.0, < 2.0)
148
+ rspec-support (~> 3.6.0)
149
+ rspec-rails (3.6.1)
150
+ actionpack (>= 3.0)
151
+ activesupport (>= 3.0)
152
+ railties (>= 3.0)
153
+ rspec-core (~> 3.6.0)
154
+ rspec-expectations (~> 3.6.0)
155
+ rspec-mocks (~> 3.6.0)
156
+ rspec-support (~> 3.6.0)
157
+ rspec-support (3.6.0)
158
+ simplecov (0.15.0)
159
+ docile (~> 1.1.0)
160
+ json (>= 1.8, < 3)
161
+ simplecov-html (~> 0.10.0)
162
+ simplecov-html (0.10.2)
163
+ sprockets (3.7.1)
164
+ concurrent-ruby (~> 1.0)
165
+ rack (> 1, < 3)
166
+ sprockets-rails (3.2.0)
167
+ actionpack (>= 4.0)
168
+ activesupport (>= 4.0)
169
+ sprockets (>= 3.0.0)
170
+ sqlite3 (1.3.13)
171
+ thor (0.20.0)
172
+ thread_safe (0.3.6)
173
+ tzinfo (1.2.3)
174
+ thread_safe (~> 0.1)
175
+ url (0.3.2)
176
+ xpath (2.1.0)
177
+ nokogiri (~> 1.3)
178
+ yard (0.9.9)
179
+
180
+ PLATFORMS
181
+ ruby
182
+
183
+ DEPENDENCIES
184
+ bundler
185
+ capybara
186
+ codecov
187
+ cucumber-rails
188
+ database_cleaner
189
+ fabrication!
190
+ factory_bot
191
+ git
192
+ machinist
193
+ pickle!
194
+ rack
195
+ rails (~> 4.2.6)
196
+ rspec-rails (~> 3.0)
197
+ sqlite3
198
+ yard
199
+
200
+ BUNDLED WITH
201
+ 1.16.0
@@ -1,3 +1,6 @@
1
+ == 0.5.4
2
+ * updated FactoryGirl to FactoryBot
3
+
1
4
  == 0.5.3
2
5
  * small fix to pickle_path_for_resources_action_segment
3
6
  * update for fabrication adapter with protected method klass
data/README.md CHANGED
@@ -88,7 +88,7 @@ Given a post exists with title: "My Post", body: "My body"
88
88
 
89
89
  ### Using with factory-girl or machinist
90
90
 
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
91
+ 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
92
 
93
93
  ```gherkin
94
94
  Given a user exists
@@ -107,14 +107,14 @@ In your `features/support/env.rb` add the following lines at the bottom
107
107
  require "#{Rails.root}/spec/blueprints" # or wherever they live
108
108
  ```
109
109
 
110
- #### FactoryGirl: make sure factories are loaded
110
+ #### FactoryBot: make sure factories are loaded
111
111
 
112
112
  In your config/environments/cucumber.rb file, make sure the factory-girl gem is included (unless it's installed as a plugin).
113
113
 
114
- If that doesn't solve loading issues then require your factories.rb file directly in a file called 'features/support/factory_girl.rb'
114
+ If that doesn't solve loading issues then require your factories.rb file directly in a file called 'features/support/factory_bot.rb'
115
115
 
116
116
  ```ruby
117
- # example features/support/factory_girl.rb
117
+ # example features/support/factory_bot.rb
118
118
  require File.dirname(__FILE__) + '/../../spec/factories'
119
119
  ```
120
120
 
@@ -174,7 +174,7 @@ Given a user exists with name: "Fred"
174
174
  Given a user exists with name: "Fred", activated: false
175
175
  ```
176
176
 
177
- This last step could be better expressed by using Machinist/FactoryGirl to create an activated user. Then you can do
177
+ This last step could be better expressed by using Machinist/FactoryBot to create an activated user. Then you can do
178
178
 
179
179
  ```gherkin
180
180
  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 ~@wip]
6
6
  end
7
7
 
8
8
  desc "setup a rails app for running cucumber"
@@ -16,12 +16,13 @@ namespace :cucumber do
16
16
  Bundler.with_clean_env do
17
17
  gemfile = "cucumber_test_app/Gemfile"
18
18
  rm_rf "cucumber_test_app"
19
- sh "bundle exec rails new cucumber_test_app --skip-javascript --skip-sprockets"
19
+ sh "bundle exec rails new cucumber_test_app --skip-spring --skip-javascript --skip-sprockets"
20
20
  sh "echo 'gem \"cucumber-rails\", :require => false' >> #{gemfile}"
21
21
  sh "echo 'gem \"rspec-rails\", \"~>3.0\"' >> #{gemfile}"
22
22
  sh "echo 'gem \"capybara\"' >> #{gemfile}"
23
+ sh "echo 'gem \"pickle\", path: \"#{__dir__}/..\"' >> #{gemfile}"
23
24
  sh "bundle install --gemfile=#{gemfile}"
24
- sh "ln -s ../../.. cucumber_test_app/vendor/plugins/pickle"
25
+ sh "(cd cucumber_test_app ; bundle exec rake db:migrate)"
25
26
  end
26
27
  end
27
28
  end
@@ -0,0 +1,3 @@
1
+ task :repoclean do
2
+ system "rm -fr pickle-email-* .bundle/ .yardoc/ cucumber_test_app/ doc/ tmp"
3
+ end
@@ -1,13 +1,13 @@
1
1
  # Factories
2
- require 'factory_girl'
2
+ require 'factory_bot'
3
3
 
4
- FactoryGirl.define do
4
+ FactoryBot.define do
5
5
  sequence :fork_name do |n|
6
6
  "fork %d04" % n
7
7
  end
8
8
 
9
9
  factory :fork do |f|
10
- f.name { FactoryGirl.generate(:fork_name) }
10
+ f.name { FactoryBot.generate(:fork_name) }
11
11
  end
12
12
 
13
13
  factory :tine do |t|
@@ -20,6 +20,6 @@ FactoryGirl.define do
20
20
  end
21
21
 
22
22
  factory :fancy_fork, :class => Fork do |t|
23
- t.name { "Fancy " + FactoryGirl.generate(:fork_name) }
23
+ t.name { "Fancy " + FactoryBot.generate(:fork_name) }
24
24
  end
25
25
  end
@@ -1,3 +1,4 @@
1
+ @wip
1
2
  Feature: I can test emails are sent
2
3
  In order write features with emails as outcomes
3
4
  As a feature writer
@@ -1,12 +1,12 @@
1
1
  Given(/^an email "(.*?)" with body: "(.*?)" is delivered to (.+?)$/) do |subject, body, to|
2
- Notifier.email(to, subject, body).deliver
2
+ Notifier.email(to, subject, body).deliver_now
3
3
  end
4
4
 
5
5
  Given(/^an email with a link "(.+?)" to (.+?) is delivered to (.+?)$/) do |text, page, to|
6
- body = "some text <a href='http://example.com/#{path_to(page)}'>#{text}</a> more text"
7
- Notifier.email(to, "example", body).deliver
6
+ body = "some text <a href='http://example.com/#{path_to(page)}'>#{text}</a> more text"
7
+ Notifier.email(to, "example", body).deliver_now
8
8
  end
9
9
 
10
10
  Given(/^#{capture_model}'s email is delivered$/) do |model|
11
- Notifier.user_email(model!(model)).deliver
12
- end
11
+ Notifier.user_email(model!(model)).deliver_now
12
+ end
@@ -1,14 +1,20 @@
1
1
  # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2
- # It is recommended to regenerate this file in the future when you upgrade to a
3
- # newer version of cucumber-rails. Consider adding your own code to a new file
2
+ # It is recommended to regenerate this file in the future when you upgrade to a
3
+ # newer version of cucumber-rails. Consider adding your own code to a new file
4
4
  # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
5
  # files.
6
6
 
7
7
  ENV["RAILS_ENV"] ||= "test"
8
8
  ENV["RAILS_ROOT"] ||= File.expand_path(File.dirname(__FILE__) + '/../../cucumber_test_app')
9
9
 
10
+ Bundler.setup
11
+
12
+ require 'simplecov'
13
+ require 'codecov'
14
+ SimpleCov.formatter = SimpleCov::Formatter::Codecov
15
+
10
16
  require 'capybara'
11
17
  require 'cucumber/rails'
12
18
  Capybara.default_selector = :css
13
19
  ActionController::Base.allow_rescue = false
14
- DatabaseCleaner.strategy = :truncation
20
+ DatabaseCleaner.strategy = :truncation
@@ -7,9 +7,9 @@
7
7
  # require 'machinist/active_record' # or your chosen adaptor
8
8
  # require File.dirname(__FILE__) + '/../../spec/blueprints' # or wherever your blueprints are
9
9
  #
10
- # For FactoryGirl add: features/support/factory_girl.rb
10
+ # For FactoryBot add: features/support/factory_bot.rb
11
11
  #
12
- # require 'factory_girl'
12
+ # require 'factory_bot'
13
13
  # require File.dirname(__FILE__) + '/../../spec/factories' # or wherever your factories are
14
14
  #
15
15
  # For Fabrication, just include it in the adapter list when configuring pickle as explained below.
@@ -1,4 +1,3 @@
1
- require 'active_support'
2
1
  require 'pickle/version'
3
2
  require 'pickle/adapter'
4
3
  require 'pickle/config'
@@ -1,5 +1,3 @@
1
- require 'active_support/core_ext'
2
-
3
1
  module Pickle
4
2
  # Abstract Factory adapter class, if you have a factory type setup, you
5
3
  # can easily create an adaptor to make it work with Pickle.
@@ -100,11 +98,11 @@ module Pickle
100
98
  end
101
99
 
102
100
  # factory-girl adapter
103
- class FactoryGirl < Adapter
101
+ class FactoryBot < Adapter
104
102
  def self.factories
105
- if defined? ::FactoryGirl
103
+ if defined? ::FactoryBot
106
104
  factories = []
107
- ::FactoryGirl.factories.each do |factory|
105
+ ::FactoryBot.factories.each do |factory|
108
106
  factory.names.each do |name|
109
107
  factories << new(factory, name)
110
108
  end
@@ -116,7 +114,7 @@ module Pickle
116
114
  end
117
115
 
118
116
  def initialize(factory, factory_name)
119
- if defined? ::FactoryGirl
117
+ if defined? ::FactoryBot
120
118
  @klass, @name = factory.build_class, factory_name.to_s
121
119
  else
122
120
  @klass, @name = factory.build_class, factory.factory_name.to_s
@@ -124,16 +122,16 @@ module Pickle
124
122
  end
125
123
 
126
124
  def create(attrs = {})
127
- if defined? ::FactoryGirl
128
- ::FactoryGirl.create(@name, attrs)
125
+ if defined? ::FactoryBot
126
+ ::FactoryBot.create(@name, attrs)
129
127
  else
130
128
  Factory(@name, attrs)
131
129
  end
132
130
  end
133
131
 
134
132
  def build(attrs = {})
135
- if defined? ::FactoryGirl
136
- ::FactoryGirl.build(@name, attrs)
133
+ if defined? ::FactoryBot
134
+ ::FactoryBot.build(@name, attrs)
137
135
  else
138
136
  Factory.build(@name, attrs)
139
137
  end
@@ -11,7 +11,7 @@ module Pickle
11
11
  end
12
12
 
13
13
  def adapters
14
- @adapters ||= [:machinist, :factory_girl, :fabrication, :orm]
14
+ @adapters ||= [:machinist, :factory_bot, :fabrication, :orm]
15
15
  end
16
16
 
17
17
  def adapter_classes
@@ -1,3 +1,3 @@
1
1
  module Pickle
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
@@ -6,10 +6,10 @@ Gem::Specification.new do |s|
6
6
  s.version = Pickle::VERSION.dup
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.licenses = ["MIT"]
9
- s.authors = ["Ian White", "James Le Cuirot"]
9
+ s.authors = ["Ian White", "James Le Cuirot", "Mathieu Jobin"]
10
10
  s.description = "Easy model creation and reference in your cucumber features"
11
11
  s.summary = "Easy model creation and reference in your cucumber features."
12
- s.email = ["ian.w.white@gmail.com", "chewi@aura-online.co.uk"]
12
+ s.email = ["ian.w.white@gmail.com", "chewi@aura-online.co.uk", "mathieu.jobin@gmail.com"]
13
13
  s.homepage = "https://github.com/ianwhite/pickle"
14
14
 
15
15
  s.rubyforge_project = "pickle"
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_dependency "cucumber", ">=0.8"
22
+ s.add_dependency "cucumber", ">=0.8", "< 3.0"
23
23
  s.add_dependency "rake"
24
24
 
25
25
  s.add_development_dependency "rack"
@@ -27,12 +27,13 @@ Gem::Specification.new do |s|
27
27
  s.add_development_dependency "git"
28
28
  s.add_development_dependency "yard"
29
29
  s.add_development_dependency "rspec-rails", "~>3.0"
30
- s.add_development_dependency "rails", "~>3.1.0"
30
+ s.add_development_dependency "rails", "~>4.2.6"
31
31
  s.add_development_dependency "cucumber-rails"
32
- s.add_development_dependency "factory_girl"
32
+ s.add_development_dependency "factory_bot"
33
33
  s.add_development_dependency "fabrication", '~> 2.0'
34
- s.add_development_dependency "machinist", "~>2.0"
34
+ s.add_development_dependency "machinist" # , "~>2.0"
35
35
  s.add_development_dependency "database_cleaner"
36
36
  s.add_development_dependency "capybara"
37
37
  s.add_development_dependency "sqlite3"
38
+ s.add_development_dependency "codecov"
38
39
  end
@@ -7,9 +7,9 @@
7
7
  # require 'machinist/active_record' # or your chosen adaptor
8
8
  # require File.dirname(__FILE__) + '/../../spec/blueprints' # or wherever your blueprints are
9
9
  #
10
- # For FactoryGirl add: features/support/factory_girl.rb
10
+ # For FactoryBot add: features/support/factory_bot.rb
11
11
  #
12
- # require 'factory_girl'
12
+ # require 'factory_bot'
13
13
  # require File.dirname(__FILE__) + '/../../spec/factories' # or wherever your factories are
14
14
  #
15
15
  # For Fabrication, just include it in the adapter list when configuring pickle as explained below.
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  require 'active_record'
4
- require 'factory_girl'
4
+ require 'factory_bot'
5
5
  require 'fabrication'
6
6
  require 'machinist/active_record'
7
7
  require 'pickle/adapters/active_record'
@@ -58,17 +58,17 @@ describe Pickle::Adapter do
58
58
  end
59
59
  end
60
60
 
61
- describe 'FactoryGirl' do
61
+ describe 'FactoryBot' do
62
62
  before do
63
- allow(Pickle::Adapter::FactoryGirl).to receive(:model_classes).and_return([One, One::Two, Three])
64
-
65
- if defined? ::FactoryGirl
66
- @orig_factories = ::FactoryGirl.factories.dup
67
- ::FactoryGirl.factories.clear
68
- ::FactoryGirl::Syntax::Default::DSL.new.factory(:one, :class => One) {}
69
- ::FactoryGirl::Syntax::Default::DSL.new.factory(:two, :class => One::Two) {}
70
- @factory1 = ::FactoryGirl.factories[:one]
71
- @factory2 = ::FactoryGirl.factories[:two]
63
+ allow(Pickle::Adapter::FactoryBot).to receive(:model_classes).and_return([One, One::Two, Three])
64
+
65
+ if defined? ::FactoryBot
66
+ @orig_factories = ::FactoryBot.factories.dup
67
+ ::FactoryBot.factories.clear
68
+ ::FactoryBot::Syntax::Default::DSL.new.factory(:one, :class => One) {}
69
+ ::FactoryBot::Syntax::Default::DSL.new.factory(:two, :class => One::Two) {}
70
+ @factory1 = ::FactoryBot.factories[:one]
71
+ @factory2 = ::FactoryBot.factories[:two]
72
72
  else
73
73
  @orig_factories, Factory.factories = Factory.factories, {}
74
74
  Factory.define(:one, :class => One) {}
@@ -79,23 +79,23 @@ describe Pickle::Adapter do
79
79
  end
80
80
 
81
81
  after do
82
- if defined? ::FactoryGirl
83
- ::FactoryGirl.factories.clear
84
- @orig_factories.each {|f| ::FactoryGirl.factories.add(f) }
82
+ if defined? ::FactoryBot
83
+ ::FactoryBot.factories.clear
84
+ @orig_factories.each {|f| ::FactoryBot.factories.add(f) }
85
85
  else
86
86
  Factory.factories = @orig_factories
87
87
  end
88
88
  end
89
89
 
90
90
  it ".factories should create one for each factory" do
91
- expect(Pickle::Adapter::FactoryGirl).to receive(:new).with(@factory1, @factory1.name).once
92
- expect(Pickle::Adapter::FactoryGirl).to receive(:new).with(@factory2, @factory2.name).once
93
- Pickle::Adapter::FactoryGirl.factories
91
+ expect(Pickle::Adapter::FactoryBot).to receive(:new).with(@factory1, @factory1.name).once
92
+ expect(Pickle::Adapter::FactoryBot).to receive(:new).with(@factory2, @factory2.name).once
93
+ Pickle::Adapter::FactoryBot.factories
94
94
  end
95
95
 
96
96
  describe ".new(factory, factory_name)" do
97
97
  before do
98
- @factory = Pickle::Adapter::FactoryGirl.new(@factory1, @factory1.name)
98
+ @factory = Pickle::Adapter::FactoryBot.new(@factory1, @factory1.name)
99
99
  end
100
100
 
101
101
  it "should have name of factory_name" do
@@ -106,7 +106,7 @@ describe Pickle::Adapter do
106
106
  expect(@factory.klass).to eq(One)
107
107
  end
108
108
 
109
- unless defined? ::FactoryGirl
109
+ unless defined? ::FactoryBot
110
110
  it "#create(attrs) should call Factory(<:key>, attrs)" do
111
111
  expect(Factory).to receive(:create).with("one", {:key => "val"})
112
112
  @factory.create(:key => "val")
@@ -5,12 +5,12 @@ describe Pickle::Config do
5
5
  @config = Pickle::Config.new
6
6
  end
7
7
 
8
- it "#adapters should default to :machinist, :factory_girl, :orm" do
9
- expect(@config.adapters).to eq([:machinist, :factory_girl, :fabrication, :orm])
8
+ it "#adapters should default to :machinist, :factory_bot, :orm" do
9
+ expect(@config.adapters).to eq([:machinist, :factory_bot, :fabrication, :orm])
10
10
  end
11
11
 
12
- it "#adapter_classes should default to Adapter::Machinist, Adapter::FactoryGirl, Adapter::Orm" do
13
- expect(@config.adapter_classes).to eq([Pickle::Adapter::Machinist, Pickle::Adapter::FactoryGirl, Pickle::Adapter::Fabrication, Pickle::Adapter::Orm])
12
+ it "#adapter_classes should default to Adapter::Machinist, Adapter::FactoryBot, Adapter::Orm" do
13
+ expect(@config.adapter_classes).to eq([Pickle::Adapter::Machinist, Pickle::Adapter::FactoryBot, Pickle::Adapter::Fabrication, Pickle::Adapter::Orm])
14
14
  end
15
15
 
16
16
  describe "setting adapters to [:machinist, SomeAdapter]" do
@@ -28,7 +28,7 @@ describe Pickle::Config do
28
28
  describe "#factories" do
29
29
  it "should call adaptor.factories for each adaptor" do
30
30
  expect(Pickle::Adapter::Machinist).to receive(:factories).and_return([])
31
- expect(Pickle::Adapter::FactoryGirl).to receive(:factories).and_return([])
31
+ expect(Pickle::Adapter::FactoryBot).to receive(:factories).and_return([])
32
32
  expect(Pickle::Adapter::Fabrication).to receive(:factories).and_return([])
33
33
  expect(Pickle::Adapter::Orm).to receive(:factories).and_return([])
34
34
  @config.factories
@@ -36,18 +36,18 @@ describe Pickle::Config do
36
36
 
37
37
  it "should aggregate factories into a hash using factory name as key" do
38
38
  expect(Pickle::Adapter::Machinist).to receive(:factories).and_return([@machinist = double('machinist', :name => 'machinist')])
39
- expect(Pickle::Adapter::FactoryGirl).to receive(:factories).and_return([@factory_girl = double('factory_girl', :name => 'factory_girl')])
39
+ expect(Pickle::Adapter::FactoryBot).to receive(:factories).and_return([@factory_bot = double('factory_bot', :name => 'factory_bot')])
40
40
  expect(Pickle::Adapter::Fabrication).to receive(:factories).and_return([@fabrication = double('fabrication', :name => 'fabrication')])
41
41
  expect(Pickle::Adapter::Orm).to receive(:factories).and_return([@orm = double('orm', :name => 'orm')])
42
- expect(@config.factories).to eq({'machinist' => @machinist, 'factory_girl' => @factory_girl, 'fabrication' => @fabrication, 'orm' => @orm})
42
+ expect(@config.factories).to eq({'machinist' => @machinist, 'factory_bot' => @factory_bot, 'fabrication' => @fabrication, 'orm' => @orm})
43
43
  end
44
44
 
45
45
  it "should give preference to adaptors first in the list" do
46
46
  expect(Pickle::Adapter::Machinist).to receive(:factories).and_return([@machinist_one = double('one', :name => 'one')])
47
- expect(Pickle::Adapter::FactoryGirl).to receive(:factories).and_return([@factory_girl_one = double('one', :name => 'one'), @factory_girl_two = double('two', :name => 'two')])
47
+ expect(Pickle::Adapter::FactoryBot).to receive(:factories).and_return([@factory_bot_one = double('one', :name => 'one'), @factory_bot_two = double('two', :name => 'two')])
48
48
  expect(Pickle::Adapter::Fabrication).to receive(:factories).and_return([@fabrication_one = double('one', :name => 'one'), @fabrication_three = double('three', :name => 'three')])
49
49
  expect(Pickle::Adapter::Orm).to receive(:factories).and_return([@orm_two = double('two', :name => 'two'), @orm_four = double('four', :name => 'four')])
50
- expect(@config.factories).to eq({'one' => @machinist_one, 'two' => @factory_girl_two, 'three' => @fabrication_three, 'four' => @orm_four})
50
+ expect(@config.factories).to eq({'one' => @machinist_one, 'two' => @factory_bot_two, 'three' => @fabrication_three, 'four' => @orm_four})
51
51
  end
52
52
  end
53
53
 
@@ -162,7 +162,7 @@ describe Pickle::Email do
162
162
  it "should not raise an error when the email body is not a string, but needs to_s [#26]" do
163
163
  allow(self).to receive(:visit)
164
164
  allow(@email1).to receive(:body).and_return(:a_string_body)
165
- expect { click_first_link_in_email(@email1) }.not_to raise_error
165
+ click_first_link_in_email(@email1)
166
166
  end
167
167
  end
168
168
 
@@ -37,7 +37,7 @@ describe Pickle::Session do
37
37
  end
38
38
 
39
39
  it "should raise error if pickle_parser don't know about em" do
40
- expect { subject.parse_infinity }.to raise_error
40
+ expect { subject.parse_infinity }.to raise_error(NoMethodError, /^undefined method `parse_infinity' for /)
41
41
  end
42
42
  end
43
43
 
@@ -300,10 +300,10 @@ describe Pickle::Session do
300
300
  let(:shirl) { double("shirl", :class => user_class, :id => 3) }
301
301
  let(:noname) { double("noname", :class => user_class, :id => 4) }
302
302
 
303
- if defined? ::FactoryGirl
304
- let(:super_admin_factory) { Pickle::Adapter::FactoryGirl.new(double(:build_class => user_class, :name => :super_admin), :super_admin) }
303
+ if defined? ::FactoryBot
304
+ let(:super_admin_factory) { Pickle::Adapter::FactoryBot.new(double(:build_class => user_class, :name => :super_admin), :super_admin) }
305
305
  else
306
- let(:super_admin_factory) { Pickle::Adapter::FactoryGirl.new(double(:build_class => user_class, :factory_name => :super_admin), :super_admin) }
306
+ let(:super_admin_factory) { Pickle::Adapter::FactoryBot.new(double(:build_class => user_class, :factory_name => :super_admin), :super_admin) }
307
307
  end
308
308
 
309
309
  before do
@@ -391,7 +391,7 @@ describe Pickle::Session do
391
391
  end
392
392
 
393
393
  it "#parser.parse_fields 'author: user \"JIM\"' should raise Error, as model deos not refer" do
394
- expect { pickle_parser.parse_fields('author: user "JIM"') }.to raise_error
394
+ expect { pickle_parser.parse_fields('author: user "JIM"') }.to raise_error(Pickle::Session::ModelNotKnownError, %q[The model: 'user "JIM"' is not known in this scenario. Use #create_model to create, or #find_model to find, and store a reference in this scenario.])
395
395
  end
396
396
 
397
397
  it "#parser.parse_fields 'author: the user' should return {\"author\" => <user>}" do
@@ -1,6 +1,11 @@
1
+ require 'rails'
1
2
  require 'active_support'
2
3
  require 'active_record'
3
- require 'factory_girl'
4
+ require 'factory_bot'
5
+
6
+ require 'simplecov'
7
+ require 'codecov'
8
+ SimpleCov.formatter = SimpleCov::Formatter::Codecov
4
9
 
5
10
  $:.unshift(File.expand_path('../../lib', __FILE__))
6
11
 
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pickle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian White
8
8
  - James Le Cuirot
9
+ - Mathieu Jobin
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2017-08-18 00:00:00.000000000 Z
13
+ date: 2017-11-17 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: cucumber
@@ -18,6 +19,9 @@ dependencies:
18
19
  - - ">="
19
20
  - !ruby/object:Gem::Version
20
21
  version: '0.8'
22
+ - - "<"
23
+ - !ruby/object:Gem::Version
24
+ version: '3.0'
21
25
  type: :runtime
22
26
  prerelease: false
23
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -25,6 +29,9 @@ dependencies:
25
29
  - - ">="
26
30
  - !ruby/object:Gem::Version
27
31
  version: '0.8'
32
+ - - "<"
33
+ - !ruby/object:Gem::Version
34
+ version: '3.0'
28
35
  - !ruby/object:Gem::Dependency
29
36
  name: rake
30
37
  requirement: !ruby/object:Gem::Requirement
@@ -115,14 +122,14 @@ dependencies:
115
122
  requirements:
116
123
  - - "~>"
117
124
  - !ruby/object:Gem::Version
118
- version: 3.1.0
125
+ version: 4.2.6
119
126
  type: :development
120
127
  prerelease: false
121
128
  version_requirements: !ruby/object:Gem::Requirement
122
129
  requirements:
123
130
  - - "~>"
124
131
  - !ruby/object:Gem::Version
125
- version: 3.1.0
132
+ version: 4.2.6
126
133
  - !ruby/object:Gem::Dependency
127
134
  name: cucumber-rails
128
135
  requirement: !ruby/object:Gem::Requirement
@@ -138,7 +145,7 @@ dependencies:
138
145
  - !ruby/object:Gem::Version
139
146
  version: '0'
140
147
  - !ruby/object:Gem::Dependency
141
- name: factory_girl
148
+ name: factory_bot
142
149
  requirement: !ruby/object:Gem::Requirement
143
150
  requirements:
144
151
  - - ">="
@@ -169,16 +176,16 @@ dependencies:
169
176
  name: machinist
170
177
  requirement: !ruby/object:Gem::Requirement
171
178
  requirements:
172
- - - "~>"
179
+ - - ">="
173
180
  - !ruby/object:Gem::Version
174
- version: '2.0'
181
+ version: '0'
175
182
  type: :development
176
183
  prerelease: false
177
184
  version_requirements: !ruby/object:Gem::Requirement
178
185
  requirements:
179
- - - "~>"
186
+ - - ">="
180
187
  - !ruby/object:Gem::Version
181
- version: '2.0'
188
+ version: '0'
182
189
  - !ruby/object:Gem::Dependency
183
190
  name: database_cleaner
184
191
  requirement: !ruby/object:Gem::Requirement
@@ -221,10 +228,25 @@ dependencies:
221
228
  - - ">="
222
229
  - !ruby/object:Gem::Version
223
230
  version: '0'
231
+ - !ruby/object:Gem::Dependency
232
+ name: codecov
233
+ requirement: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
238
+ type: :development
239
+ prerelease: false
240
+ version_requirements: !ruby/object:Gem::Requirement
241
+ requirements:
242
+ - - ">="
243
+ - !ruby/object:Gem::Version
244
+ version: '0'
224
245
  description: Easy model creation and reference in your cucumber features
225
246
  email:
226
247
  - ian.w.white@gmail.com
227
248
  - chewi@aura-online.co.uk
249
+ - mathieu.jobin@gmail.com
228
250
  executables: []
229
251
  extensions: []
230
252
  extra_rdoc_files: []
@@ -233,13 +255,14 @@ files:
233
255
  - ".rspec"
234
256
  - ".travis.yml"
235
257
  - Gemfile
236
- - Gemfile.lock.development
258
+ - Gemfile.lock
237
259
  - History.txt
238
260
  - License.txt
239
261
  - README.md
240
262
  - Rakefile
241
263
  - Rakefile.d/cucumber.rake
242
264
  - Rakefile.d/release.rake
265
+ - Rakefile.d/repoclean.rake
243
266
  - Rakefile.d/rspec.rake
244
267
  - Rakefile.d/yard.rake
245
268
  - Todo.txt
@@ -270,7 +293,6 @@ files:
270
293
  - features/support/paths.rb
271
294
  - features/support/pickle.rb
272
295
  - features/support/pickle_app.rb
273
- - init.rb
274
296
  - lib/generators/pickle_generator.rb
275
297
  - lib/pickle.rb
276
298
  - lib/pickle/adapter.rb
@@ -326,7 +348,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
348
  version: 1.3.6
327
349
  requirements: []
328
350
  rubyforge_project: pickle
329
- rubygems_version: 2.6.11
351
+ rubygems_version: 2.6.13
330
352
  signing_key:
331
353
  specification_version: 4
332
354
  summary: Easy model creation and reference in your cucumber features.
@@ -1,158 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- pickle (0.5.1)
5
- cucumber (>= 0.8)
6
- rake
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
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
- builder (~> 3.0.0)
18
- erubis (~> 2.7.0)
19
- i18n (~> 0.6)
20
- rack (~> 1.3.6)
21
- rack-cache (~> 1.2)
22
- rack-mount (~> 0.8.2)
23
- rack-test (~> 0.6.1)
24
- sprockets (~> 2.0.4)
25
- activemodel (3.1.12)
26
- activesupport (= 3.1.12)
27
- builder (~> 3.0.0)
28
- i18n (~> 0.6)
29
- activerecord (3.1.12)
30
- activemodel (= 3.1.12)
31
- activesupport (= 3.1.12)
32
- arel (~> 2.2.3)
33
- tzinfo (~> 0.3.29)
34
- activeresource (3.1.12)
35
- activemodel (= 3.1.12)
36
- activesupport (= 3.1.12)
37
- activesupport (3.1.12)
38
- multi_json (~> 1.0)
39
- arel (2.2.3)
40
- builder (3.0.4)
41
- capybara (2.4.4)
42
- mime-types (>= 1.16)
43
- nokogiri (>= 1.3.3)
44
- rack (>= 1.0.0)
45
- rack-test (>= 0.5.4)
46
- xpath (~> 2.0)
47
- cucumber (1.3.18)
48
- builder (>= 2.1.2)
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.2)
54
- capybara (>= 1.1.2, < 3)
55
- cucumber (>= 1.3.8, < 2)
56
- mime-types (>= 1.16, < 3)
57
- nokogiri (~> 1.5)
58
- rails (>= 3, < 5)
59
- database_cleaner (1.4.0)
60
- diff-lcs (1.2.5)
61
- erubis (2.7.0)
62
- fabrication (2.12.0)
63
- factory_girl (4.5.0)
64
- activesupport (>= 3.0.0)
65
- gherkin (2.12.2)
66
- multi_json (~> 1.3)
67
- git (1.2.9)
68
- hike (1.2.3)
69
- i18n (0.7.0)
70
- json (1.8.2)
71
- machinist (2.0)
72
- mail (2.4.4)
73
- i18n (>= 0.4.0)
74
- mime-types (~> 1.16)
75
- treetop (~> 1.4.8)
76
- mime-types (1.25.1)
77
- mini_portile (0.6.2)
78
- multi_json (1.10.1)
79
- multi_test (0.1.1)
80
- nokogiri (1.6.5)
81
- mini_portile (~> 0.6.0)
82
- polyglot (0.3.5)
83
- rack (1.3.10)
84
- rack-cache (1.2)
85
- rack (>= 0.4)
86
- rack-mount (0.8.3)
87
- rack (>= 1.0.0)
88
- rack-ssl (1.3.4)
89
- rack
90
- rack-test (0.6.3)
91
- rack (>= 1.0)
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)
98
- bundler (~> 1.0)
99
- railties (= 3.1.12)
100
- railties (3.1.12)
101
- actionpack (= 3.1.12)
102
- activesupport (= 3.1.12)
103
- rack-ssl (~> 1.3.2)
104
- rake (>= 0.8.7)
105
- rdoc (~> 3.4)
106
- thor (~> 0.14.6)
107
- rake (10.4.2)
108
- rdoc (3.12.2)
109
- json (~> 1.4)
110
- rspec-core (3.1.7)
111
- rspec-support (~> 3.1.0)
112
- rspec-expectations (3.1.2)
113
- diff-lcs (>= 1.2.0, < 2.0)
114
- rspec-support (~> 3.1.0)
115
- rspec-mocks (3.1.3)
116
- rspec-support (~> 3.1.0)
117
- rspec-rails (3.1.0)
118
- actionpack (>= 3.0)
119
- activesupport (>= 3.0)
120
- railties (>= 3.0)
121
- rspec-core (~> 3.1.0)
122
- rspec-expectations (~> 3.1.0)
123
- rspec-mocks (~> 3.1.0)
124
- rspec-support (~> 3.1.0)
125
- rspec-support (3.1.2)
126
- sprockets (2.0.5)
127
- hike (~> 1.2)
128
- rack (~> 1.0)
129
- tilt (~> 1.1, != 1.3.0)
130
- sqlite3 (1.3.10)
131
- thor (0.14.6)
132
- tilt (1.4.1)
133
- treetop (1.4.15)
134
- polyglot
135
- polyglot (>= 0.3.1)
136
- tzinfo (0.3.42)
137
- xpath (2.0.0)
138
- nokogiri (~> 1.3)
139
- yard (0.8.7.6)
140
-
141
- PLATFORMS
142
- ruby
143
-
144
- DEPENDENCIES
145
- bundler
146
- capybara
147
- cucumber-rails
148
- database_cleaner
149
- fabrication (~> 2.0)
150
- factory_girl
151
- git
152
- machinist (~> 2.0)
153
- pickle!
154
- rack
155
- rails (~> 3.1.0)
156
- rspec-rails (~> 3.0)
157
- sqlite3
158
- yard
data/init.rb DELETED
File without changes