factory_girl_rails 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- factory_girl_rails (1.4.0)
5
- factory_girl (~> 2.3.0)
4
+ factory_girl_rails (1.5.0)
5
+ factory_girl (~> 2.4.0)
6
6
  railties (>= 3.0.0)
7
7
 
8
8
  GEM
@@ -56,7 +56,7 @@ GEM
56
56
  diff-lcs (1.1.2)
57
57
  erubis (2.6.6)
58
58
  abstract (>= 1.0.0)
59
- factory_girl (2.3.0)
59
+ factory_girl (2.4.0)
60
60
  activesupport
61
61
  ffi (1.0.9)
62
62
  gherkin (2.4.1)
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require 'bundler/setup'
1
2
  require 'bundler/gem_tasks'
2
3
  require 'cucumber/rake/task'
3
4
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{factory_girl_rails}
3
- s.version = '1.4.0'
3
+ s.version = '1.5.0'
4
4
  s.authors = ["Joe Ferris"]
5
5
  s.email = %q{jferris@thoughtbot.com}
6
6
  s.homepage = "http://github.com/thoughtbot/factory_girl_rails"
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.require_paths = ["lib"]
17
17
 
18
18
  s.add_runtime_dependency('railties', '>= 3.0.0')
19
- s.add_runtime_dependency('factory_girl', '~> 2.3.0')
19
+ s.add_runtime_dependency('factory_girl', '~> 2.4.0')
20
20
 
21
21
  s.add_development_dependency('rake')
22
22
  s.add_development_dependency('rspec', '~> 2.6.0')
@@ -1,7 +1,5 @@
1
1
  Feature: automatically load step definitions
2
-
3
- @disable-bundler
4
- Scenario: generate a rails 3 application and use factory definitions
2
+ Background:
5
3
  When I successfully run `bundle exec rails new testapp`
6
4
  And I cd to "testapp"
7
5
  And I add "factory_girl_rails" from this project as a dependency
@@ -22,6 +20,9 @@ Feature: automatically load step definitions
22
20
  class User < ActiveRecord::Base
23
21
  end
24
22
  """
23
+
24
+ @disable-bundler
25
+ Scenario: generate a rails 3 application and use factory definitions
25
26
  When I write to "test/factories.rb" with:
26
27
  """
27
28
  FactoryGirl.define do
@@ -43,3 +44,42 @@ Feature: automatically load step definitions
43
44
  """
44
45
  When I successfully run `bundle exec rake test --trace`
45
46
  Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors"
47
+
48
+ @disable-bundler
49
+ Scenario: use factories advertised by railties/engines/3rd-party gems
50
+ When I append to "config/application.rb" with:
51
+ """
52
+ require File.expand_path('../../lib/some_railtie/railties.rb', __FILE__)
53
+ """
54
+ When I write to "lib/some_railtie/railties.rb" with:
55
+ """
56
+ module SomeRailtie
57
+ class Railtie < ::Rails::Engine
58
+
59
+ initializer "some_railtie.factories", :after => "factory_girl.set_factory_paths" do
60
+ FactoryGirl.definition_file_paths << File.expand_path('../factories', __FILE__)
61
+ end
62
+ end
63
+ end
64
+ """
65
+ When I write to "lib/some_railtie/factories.rb" with:
66
+ """
67
+ FactoryGirl.define do
68
+ factory :factory_from_some_railtie, :class => 'User' do
69
+ name 'Artem'
70
+ end
71
+ end
72
+ """
73
+ When I write to "test/unit/user_test.rb" with:
74
+ """
75
+ require 'test_helper'
76
+
77
+ class UserTest < ActiveSupport::TestCase
78
+ test "use factory of some_railtie" do
79
+ user = FactoryGirl.create(:factory_from_some_railtie)
80
+ assert_equal 'Artem', user.name
81
+ end
82
+ end
83
+ """
84
+ When I successfully run `bundle exec rake test --trace`
85
+ Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors"
@@ -14,12 +14,15 @@ module FactoryGirl
14
14
  end
15
15
  end
16
16
 
17
- config.after_initialize do
17
+ initializer "factory_girl.set_factory_paths" do
18
18
  FactoryGirl.definition_file_paths = [
19
19
  File.join(Rails.root, 'factories'),
20
20
  File.join(Rails.root, 'test', 'factories'),
21
21
  File.join(Rails.root, 'spec', 'factories')
22
22
  ]
23
+ end
24
+
25
+ config.after_initialize do
23
26
  FactoryGirl.find_definitions
24
27
  end
25
28
  end
metadata CHANGED
@@ -1,107 +1,100 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: factory_girl_rails
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.0
4
5
  prerelease:
5
- version: 1.4.0
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Joe Ferris
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-11-18 00:00:00 -05:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2012-01-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: railties
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70348084760780 !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
24
21
  version: 3.0.0
25
22
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: factory_girl
29
23
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70348084760780
25
+ - !ruby/object:Gem::Dependency
26
+ name: factory_girl
27
+ requirement: &70348084759880 !ruby/object:Gem::Requirement
31
28
  none: false
32
- requirements:
29
+ requirements:
33
30
  - - ~>
34
- - !ruby/object:Gem::Version
35
- version: 2.3.0
31
+ - !ruby/object:Gem::Version
32
+ version: 2.4.0
36
33
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: rake
40
34
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70348084759880
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
38
+ requirement: &70348084758760 !ruby/object:Gem::Requirement
42
39
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
47
44
  type: :development
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: rspec
51
45
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70348084758760
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: &70348084756600 !ruby/object:Gem::Requirement
53
50
  none: false
54
- requirements:
51
+ requirements:
55
52
  - - ~>
56
- - !ruby/object:Gem::Version
53
+ - !ruby/object:Gem::Version
57
54
  version: 2.6.0
58
55
  type: :development
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
61
- name: cucumber
62
56
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70348084756600
58
+ - !ruby/object:Gem::Dependency
59
+ name: cucumber
60
+ requirement: &70348084755920 !ruby/object:Gem::Requirement
64
61
  none: false
65
- requirements:
62
+ requirements:
66
63
  - - ~>
67
- - !ruby/object:Gem::Version
64
+ - !ruby/object:Gem::Version
68
65
  version: 1.0.0
69
66
  type: :development
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
72
- name: aruba
73
67
  prerelease: false
74
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *70348084755920
69
+ - !ruby/object:Gem::Dependency
70
+ name: aruba
71
+ requirement: &70348084755260 !ruby/object:Gem::Requirement
75
72
  none: false
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- version: "0"
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
80
77
  type: :development
81
- version_requirements: *id006
82
- - !ruby/object:Gem::Dependency
83
- name: rails
84
78
  prerelease: false
85
- requirement: &id007 !ruby/object:Gem::Requirement
79
+ version_requirements: *70348084755260
80
+ - !ruby/object:Gem::Dependency
81
+ name: rails
82
+ requirement: &70348084747900 !ruby/object:Gem::Requirement
86
83
  none: false
87
- requirements:
88
- - - "="
89
- - !ruby/object:Gem::Version
84
+ requirements:
85
+ - - =
86
+ - !ruby/object:Gem::Version
90
87
  version: 3.0.7
91
88
  type: :development
92
- version_requirements: *id007
93
- description: |-
94
- factory_girl_rails provides integration between
95
- factory_girl and rails 3 (currently just automatic factory definition
96
- loading)
89
+ prerelease: false
90
+ version_requirements: *70348084747900
91
+ description: ! "factory_girl_rails provides integration between\n factory_girl
92
+ and rails 3 (currently just automatic factory definition\n loading)"
97
93
  email: jferris@thoughtbot.com
98
94
  executables: []
99
-
100
95
  extensions: []
101
-
102
96
  extra_rdoc_files: []
103
-
104
- files:
97
+ files:
105
98
  - .bundle/config
106
99
  - .gitignore
107
100
  - CONTRIBUTING.md
@@ -118,41 +111,37 @@ files:
118
111
  - features/support/env.rb
119
112
  - lib/factory_girl_rails.rb
120
113
  - lib/factory_girl_rails/railtie.rb
121
- - lib/factory_girl_rails/version.rb
122
114
  - lib/generators/factory_girl.rb
123
115
  - lib/generators/factory_girl/model/model_generator.rb
124
116
  - lib/generators/factory_girl/model/templates/fixtures.rb
125
- has_rdoc: true
126
117
  homepage: http://github.com/thoughtbot/factory_girl_rails
127
118
  licenses: []
128
-
129
119
  post_install_message:
130
120
  rdoc_options: []
131
-
132
- require_paths:
121
+ require_paths:
133
122
  - lib
134
- required_ruby_version: !ruby/object:Gem::Requirement
123
+ required_ruby_version: !ruby/object:Gem::Requirement
135
124
  none: false
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: "0"
140
- required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ! '>='
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
130
  none: false
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: "0"
131
+ requirements:
132
+ - - ! '>='
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
146
135
  requirements: []
147
-
148
136
  rubyforge_project:
149
- rubygems_version: 1.6.2
137
+ rubygems_version: 1.8.10
150
138
  signing_key:
151
139
  specification_version: 3
152
140
  summary: factory_girl_rails provides integration between factory_girl and rails 3
153
- test_files:
141
+ test_files:
154
142
  - features/fixture_replacement_config.feature
155
143
  - features/generators.feature
156
144
  - features/load_definitions.feature
157
145
  - features/step_definitions/rails_steps.rb
158
146
  - features/support/env.rb
147
+ has_rdoc:
@@ -1 +0,0 @@
1
- module FactoryGirl