cucumber_factory 1.8.1 → 1.8.2

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.
@@ -109,8 +109,8 @@ module Cucumber
109
109
 
110
110
  def create_record(model_class, variant, attributes)
111
111
  fg_factory_name = factory_girl_factory_name(variant || model_class)
112
- if defined?(::Factory) && factory = ::Factory.factories[fg_factory_name]
113
- ::Factory.create(fg_factory_name, attributes)
112
+ if defined?(::FactoryGirl) && factory = ::FactoryGirl.factories[fg_factory_name]
113
+ ::FactoryGirl.create(fg_factory_name, attributes)
114
114
  elsif model_class.respond_to?(:make) # Machinist blueprint
115
115
  if variant.present?
116
116
  model_class.make(variant.to_sym, attributes)
@@ -1,3 +1,3 @@
1
1
  module CucumberFactory
2
- VERSION = '1.8.1'
2
+ VERSION = '1.8.2'
3
3
  end
data/spec/steps_spec.rb CHANGED
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  require 'cucumber'
4
4
  require 'cucumber/rb_support/rb_language'
5
5
 
6
- class Factory # for factory_girl compatibility spec
6
+ class FactoryGirl # for factory_girl compatibility spec
7
7
  def self.factories
8
8
  {}
9
9
  end
@@ -37,15 +37,15 @@ describe 'steps provided by cucumber_factory' do
37
37
  invoke_cucumber_step('there is a machinist model (Variant Mark Two) with the attribute "foo"')
38
38
  end
39
39
 
40
- it "should create models that have a factory_girl factory by calling #Factory.make(:model_name)" do
41
- Factory.should_receive(:factories).with().and_return({ :job_offer => :job_offer_factory }) # Fake factory look up in factory_girl
42
- Factory.should_receive(:create).with(:job_offer, { :title => "Awesome job" })
40
+ it "should create models that have a factory_girl factory by calling #FactoryGirl.create(:model_name)" do
41
+ FactoryGirl.should_receive(:factories).with().and_return({ :job_offer => :job_offer_factory }) # Fake factory look up in factory_girl
42
+ FactoryGirl.should_receive(:create).with(:job_offer, { :title => "Awesome job" })
43
43
  invoke_cucumber_step('there is a job offer with the title "Awesome job"')
44
44
  end
45
45
 
46
- it "should create model variants that have a factory_girl factory by calling #Factory.make(:variant_name)" do
47
- Factory.should_receive(:factories).with().and_return({ :tempting_job_offer => :tempting_job_offer_factory }) # Fake factory look up in factory_girl
48
- Factory.should_receive(:create).with(:tempting_job_offer, { :title => "Awesomafiablyfantasmic job" })
46
+ it "should create model variants that have a factory_girl factory by calling #FactoryGirl.create(:variant_name)" do
47
+ FactoryGirl.should_receive(:factories).with().and_return({ :tempting_job_offer => :tempting_job_offer_factory }) # Fake factory look up in factory_girl
48
+ FactoryGirl.should_receive(:create).with(:tempting_job_offer, { :title => "Awesomafiablyfantasmic job" })
49
49
  invoke_cucumber_step('there is a job offer (tempting job offer) with the title "Awesomafiablyfantasmic job"')
50
50
  end
51
51
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_factory
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 8
9
- - 1
10
- version: 1.8.1
9
+ - 2
10
+ version: 1.8.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Henning Koch
@@ -15,11 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-24 00:00:00 +02:00
18
+ date: 2012-01-04 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: cucumber
23
22
  prerelease: false
24
23
  requirement: &id001 !ruby/object:Gem::Requirement
25
24
  none: false
@@ -30,10 +29,10 @@ dependencies:
30
29
  segments:
31
30
  - 0
32
31
  version: "0"
33
- type: :runtime
32
+ name: cucumber
34
33
  version_requirements: *id001
34
+ type: :runtime
35
35
  - !ruby/object:Gem::Dependency
36
- name: rails
37
36
  prerelease: false
38
37
  requirement: &id002 !ruby/object:Gem::Requirement
39
38
  none: false
@@ -45,10 +44,10 @@ dependencies:
45
44
  - 2
46
45
  - 3
47
46
  version: "2.3"
48
- type: :development
47
+ name: rails
49
48
  version_requirements: *id002
49
+ type: :development
50
50
  - !ruby/object:Gem::Dependency
51
- name: rspec
52
51
  prerelease: false
53
52
  requirement: &id003 !ruby/object:Gem::Requirement
54
53
  none: false
@@ -59,10 +58,10 @@ dependencies:
59
58
  segments:
60
59
  - 2
61
60
  version: "2"
62
- type: :development
61
+ name: rspec
63
62
  version_requirements: *id003
63
+ type: :development
64
64
  - !ruby/object:Gem::Dependency
65
- name: rspec-rails
66
65
  prerelease: false
67
66
  requirement: &id004 !ruby/object:Gem::Requirement
68
67
  none: false
@@ -75,10 +74,10 @@ dependencies:
75
74
  - 3
76
75
  - 4
77
76
  version: 1.3.4
78
- type: :development
77
+ name: rspec-rails
79
78
  version_requirements: *id004
79
+ type: :development
80
80
  - !ruby/object:Gem::Dependency
81
- name: sqlite3
82
81
  prerelease: false
83
82
  requirement: &id005 !ruby/object:Gem::Requirement
84
83
  none: false
@@ -89,8 +88,9 @@ dependencies:
89
88
  segments:
90
89
  - 0
91
90
  version: "0"
92
- type: :development
91
+ name: sqlite3
93
92
  version_requirements: *id005
93
+ type: :development
94
94
  description: Cucumber Factory allows you to create ActiveRecord models from your Cucumber features without writing step definitions for each model.
95
95
  email: github@makandra.de
96
96
  executables: []
@@ -171,39 +171,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  requirements: []
172
172
 
173
173
  rubyforge_project:
174
- rubygems_version: 1.6.2
174
+ rubygems_version: 1.3.9.3
175
175
  signing_key:
176
176
  specification_version: 3
177
177
  summary: Create records from Cucumber features without writing step definitions.
178
- test_files:
179
- - spec/app_root/app/controllers/application_controller.rb
180
- - spec/app_root/app/models/job_offer.rb
181
- - spec/app_root/app/models/machinist_model.rb
182
- - spec/app_root/app/models/movie.rb
183
- - spec/app_root/app/models/opera.rb
184
- - spec/app_root/app/models/payment.rb
185
- - spec/app_root/app/models/people/actor.rb
186
- - spec/app_root/app/models/plain_ruby_class.rb
187
- - spec/app_root/app/models/user.rb
188
- - spec/app_root/config/boot.rb
189
- - spec/app_root/config/database.yml
190
- - spec/app_root/config/environment.rb
191
- - spec/app_root/config/environments/in_memory.rb
192
- - spec/app_root/config/environments/mysql.rb
193
- - spec/app_root/config/environments/postgresql.rb
194
- - spec/app_root/config/environments/sqlite.rb
195
- - spec/app_root/config/environments/sqlite3.rb
196
- - spec/app_root/config/routes.rb
197
- - spec/app_root/db/migrate/001_create_movies.rb
198
- - spec/app_root/db/migrate/002_create_users.rb
199
- - spec/app_root/db/migrate/003_create_payments.rb
200
- - spec/app_root/db/migrate/004_create_actors.rb
201
- - spec/app_root/lib/console_with_fixtures.rb
202
- - spec/app_root/log/.gitignore
203
- - spec/app_root/script/console
204
- - spec/factory_spec.rb
205
- - spec/runtime_ext_spec.rb
206
- - spec/spec_helper.rb
207
- - spec/steps_spec.rb
208
- - spec/support/rcov.opts
209
- - spec/support/spec.opts
178
+ test_files: []
179
+