diff --git a/features/fixture_replacement_config.feature b/features/fixture_replacement_config.feature index 732f1f3..f5cd902 100644 --- a/features/fixture_replacement_config.feature +++ b/features/fixture_replacement_config.feature @@ -1,19 +1,15 @@ -@disable-bundler Feature: - In order to not have to manually configure factory girl as the testing fixture replacement - by using the --fixture-replacement=factory_girl option - as a Rails3 and Factory Girl user - I would like the Factory Girl Rails gem to configure Factory Girl - as the fixture replacement. + In order to not have to manually configure factory girl as the testing fixture replacement by using the --fixture-replacement=factory_girl option as a Rails3 and Factory Girl user + I would like the Factory Girl Rails gem to configure Factory Girl as the fixture replacement. Background: Given I successfully run `bundle exec rails new testapp` And I cd to "testapp" And I add "factory_girl_rails" from this project as a dependency - And I configure the database connection for the application + And I configure the database connection for the application + And I reset Bundler environment variable - Scenario: Using Factory Girl and Factory Girl Rails with Test Unit generates - a factory file and does not generate a fixture file + Scenario: Using Factory Girl and Factory Girl Rails with Test Unit generates a factory file and does not generate a fixture file And I successfully run `bundle install` And I successfully run `bundle exec rails generate model User name:string` Then the following files should exist: @@ -21,9 +17,8 @@ Feature: And the following files should not exist: | test/fixtures/users.yml | - Scenario: Using Factory Girl and Factory Girl Rails with RSpec should generate a factory file - And I add "rspec-rails" as a dependency + When I add "rspec-rails" as a dependency And I successfully run `bundle install` And I successfully run `bundle exec rails generate model User name:string` Then the following files should exist: diff --git a/features/generators.feature b/features/generators.feature index 94b717f..a9d1eb4 100644 --- a/features/generators.feature +++ b/features/generators.feature @@ -3,12 +3,14 @@ Feature: As a user of Rails3 and factory_girl I would like to use factory_girl_rails generators. - Scenario: The factory_girl_rails generators create a factory file - for each model that I generate - When I successfully run `bundle exec rails new testapp` + Background: + Given I successfully run `bundle exec rails new testapp` And I cd to "testapp" And I add "factory_girl_rails" from this project as a dependency - And I configure the database connection for the application + And I configure the database connection for the application + And I reset Bundler environment variable + + Scenario: The factory_girl_rails generators create a factory file for each model that I generate When I successfully run `bundle install` And I successfully run `bundle exec rails generate model User name:string --fixture-replacement=factory_girl` And I successfully run `bundle exec rails generate model Namespaced::User name:string --fixture-replacement=factory_girl` @@ -17,12 +19,7 @@ Feature: And the file "test/factories/users.rb" should contain "factory :user do" And the file "test/factories/namespaced_users.rb" should contain "factory :namespaced_user, :class => 'Namespaced::User' do" - Scenario: The factory_girl_rails generators create a factory file with a - custom name for each model that I generate - When I successfully run `bundle exec rails new testapp` - And I cd to "testapp" - And I add "factory_girl_rails" from this project as a dependency - And I configure the database connection for the application + Scenario: The factory_girl_rails generators create a factory file with a custom name for each model that I generate When I successfully run `bundle install` And I set the FactoryGirl :suffix option to "factory" And I successfully run `bundle exec rails generate model User name:string --fixture-replacement=factory_girl` diff --git a/features/load_definitions.feature b/features/load_definitions.feature index ce4b1d1..cbe8078 100644 --- a/features/load_definitions.feature +++ b/features/load_definitions.feature @@ -1,9 +1,11 @@ Feature: automatically load step definitions + Background: When I successfully run `bundle exec rails new testapp` And I cd to "testapp" And I add "factory_girl_rails" from this project as a dependency - And I configure the database connection for the application + And I configure the database connection for the application + And I reset Bundler environment variable When I successfully run `bundle install` And I write to "db/migrate/1_create_users.rb" with: """ @@ -22,7 +24,6 @@ Feature: automatically load step definitions end """ - @disable-bundler Scenario: generate a rails 3 application and use factory definitions When I write to "test/factories.rb" with: """ @@ -46,7 +47,6 @@ Feature: automatically load step definitions When I successfully run `bundle exec rake test --trace` Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors" - @disable-bundler Scenario: use factories advertised by railties/engines/3rd-party gems When I append to "config/application.rb" with: """ @@ -83,4 +83,4 @@ Feature: automatically load step definitions end """ When I successfully run `bundle exec rake test --trace` - Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors" \ No newline at end of file + Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors" diff --git a/features/step_definitions/appraisal.rb b/features/step_definitions/appraisal.rb new file mode 100644 index 0000000..8ef59d5 --- /dev/null +++ b/features/step_definitions/appraisal.rb @@ -0,0 +1,3 @@ +When /^I reset Bundler environment variable$/ do + unset_bundler_env_vars +end diff --git a/gemfiles/rails3.0.gemfile.lock b/gemfiles/rails3.0.gemfile.lock index 89e8828..d9ea6da 100644 --- a/gemfiles/rails3.0.gemfile.lock +++ b/gemfiles/rails3.0.gemfile.lock @@ -31,10 +31,6 @@ GEM activesupport (= 3.0.17) arel (~> 2.0.10) tzinfo (~> 0.3.23) - activerecord-jdbc-adapter (1.2.2.1) - activerecord-jdbcsqlite3-adapter (1.2.2.1) - activerecord-jdbc-adapter (~> 1.2.2.1) - jdbc-sqlite3 (~> 3.7.2) activeresource (3.0.17) activemodel (= 3.0.17) activesupport (= 3.0.17) @@ -61,15 +57,10 @@ GEM factory_girl (4.1.0) activesupport (>= 3.0.0) ffi (1.2.0) - ffi (1.2.0-java) gherkin (2.11.5) json (>= 1.4.6) - gherkin (2.11.5-java) - json (>= 1.4.6) i18n (0.5.0) - jdbc-sqlite3 (3.7.2) json (1.7.5) - json (1.7.5-java) mail (2.2.19) activesupport (>= 2.3.6) i18n (>= 0.4.0) @@ -96,7 +87,7 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (~> 0.14.4) - rake (10.0.2) + rake (10.0.3) rdoc (3.12) json (~> 1.4) rspec (2.11.0) @@ -115,7 +106,6 @@ GEM tzinfo (0.3.35) PLATFORMS - java ruby DEPENDENCIES diff --git a/gemfiles/rails3.1.gemfile.lock b/gemfiles/rails3.1.gemfile.lock index 70f2451..7c7cc0d 100644 --- a/gemfiles/rails3.1.gemfile.lock +++ b/gemfiles/rails3.1.gemfile.lock @@ -31,10 +31,6 @@ GEM activesupport (= 3.1.8) arel (~> 2.2.3) tzinfo (~> 0.3.29) - activerecord-jdbc-adapter (1.2.2.1) - activerecord-jdbcsqlite3-adapter (1.2.2.1) - activerecord-jdbc-adapter (~> 1.2.2.1) - jdbc-sqlite3 (~> 3.7.2) activeresource (3.1.8) activemodel (= 3.1.8) activesupport (= 3.1.8) @@ -61,16 +57,11 @@ GEM factory_girl (4.1.0) activesupport (>= 3.0.0) ffi (1.2.0) - ffi (1.2.0-java) gherkin (2.11.5) json (>= 1.4.6) - gherkin (2.11.5-java) - json (>= 1.4.6) hike (1.2.1) i18n (0.6.1) - jdbc-sqlite3 (3.7.2) json (1.7.5) - json (1.7.5-java) mail (2.3.3) i18n (>= 0.4.0) mime-types (~> 1.16) @@ -102,7 +93,7 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (~> 0.14.6) - rake (10.0.2) + rake (10.0.3) rdoc (3.12) json (~> 1.4) rspec (2.11.0) @@ -126,7 +117,6 @@ GEM tzinfo (0.3.35) PLATFORMS - java ruby DEPENDENCIES diff --git a/gemfiles/rails3.2.gemfile.lock b/gemfiles/rails3.2.gemfile.lock index 1caf860..885a0b4 100644 --- a/gemfiles/rails3.2.gemfile.lock +++ b/gemfiles/rails3.2.gemfile.lock @@ -29,10 +29,6 @@ GEM activesupport (= 3.2.9) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activerecord-jdbc-adapter (1.2.2.1) - activerecord-jdbcsqlite3-adapter (1.2.2.1) - activerecord-jdbc-adapter (~> 1.2.2.1) - jdbc-sqlite3 (~> 3.7.2) activeresource (3.2.9) activemodel (= 3.2.9) activesupport (= 3.2.9) @@ -60,17 +56,12 @@ GEM factory_girl (4.1.0) activesupport (>= 3.0.0) ffi (1.2.0) - ffi (1.2.0-java) gherkin (2.11.5) json (>= 1.4.6) - gherkin (2.11.5-java) - json (>= 1.4.6) hike (1.2.1) i18n (0.6.1) - jdbc-sqlite3 (3.7.2) journey (1.0.4) json (1.7.5) - json (1.7.5-java) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) @@ -100,7 +91,7 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (10.0.2) + rake (10.0.3) rdoc (3.12) json (~> 1.4) rspec (2.11.0) @@ -125,7 +116,6 @@ GEM tzinfo (0.3.35) PLATFORMS - java ruby DEPENDENCIES