From e3ced5fb4ef67e0010ad3931c06bdf7ef2620715 Mon Sep 17 00:00:00 2001 From: Greg Lazarev Date: Mon, 1 Apr 2013 09:47:37 -0700 Subject: [PATCH] Install bundle with `--local` flag in features * move gem installation to reader-friedly step * take out turn gem, which causes problems with local installs for CI --- Gemfile.lock | 2 ++ clearance.gemspec | 1 + features/add_migrations_to_project.feature | 6 +++--- features/integration_with_rspec.feature | 2 +- features/integration_with_test_unit.feature | 2 +- features/step_definitions/configuration_steps.rb | 7 ++++++- features/step_definitions/gem_file_steps.rb | 8 ++++++++ gemfiles/3.0.20.gemfile.lock | 6 ++++++ gemfiles/3.1.11.gemfile.lock | 2 ++ gemfiles/3.2.12.gemfile.lock | 6 ++++++ 10 files changed, 36 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9000b526e..45f8b5a0c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -93,6 +93,7 @@ GEM treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.19) + minitest (4.7.0) mocha (0.13.0) metaclass (~> 0.0.1) multi_json (1.5.0) @@ -175,6 +176,7 @@ DEPENDENCIES cucumber-rails (= 1.1.1) database_cleaner (= 0.8.0) factory_girl_rails (= 3.5.0) + minitest (~> 4.7.0) psych (~> 1.3.4) rspec-rails (= 2.12.2) shoulda-matchers (= 1.2.0) diff --git a/clearance.gemspec b/clearance.gemspec index 9d6ef67d4..ad98b416e 100644 --- a/clearance.gemspec +++ b/clearance.gemspec @@ -33,6 +33,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'cucumber-rails', '1.1.1' s.add_development_dependency 'database_cleaner', '0.8.0' s.add_development_dependency 'factory_girl_rails', '3.5.0' + s.add_development_dependency 'minitest', '~> 4.7.0' s.add_development_dependency 'psych', '~> 1.3.4' s.add_development_dependency 'rspec-rails', '2.12.2' s.add_development_dependency 'shoulda-matchers', '1.2.0' diff --git a/features/add_migrations_to_project.feature b/features/add_migrations_to_project.feature index 3e861a437..5635f7b12 100644 --- a/features/add_migrations_to_project.feature +++ b/features/add_migrations_to_project.feature @@ -4,7 +4,7 @@ Feature: add migrations to the project Given I have a project with clearance Scenario: Users table does not exist - When I successfully run `bundle install` + When I install dependencies And I successfully run `bundle exec rails generate clearance:install` And I successfully run `ls db/migrate` Then the output should contain: @@ -13,7 +13,7 @@ Feature: add migrations to the project """ Scenario: Users table without clearance fields exists in the database - When I successfully run `bundle install` + When I install dependencies And I create a simple migration And I successfully run `bundle exec rake db:migrate` And I successfully run `bundle exec rails generate clearance:install` @@ -24,7 +24,7 @@ Feature: add migrations to the project """ Scenario: Users table with clearance fields exists in the database - When I successfully run `bundle install` + When I install dependencies And I create a migration with clearance fields And I successfully run `bundle exec rake db:migrate` And I successfully run `bundle exec rails generate clearance:install` diff --git a/features/integration_with_rspec.feature b/features/integration_with_rspec.feature index d8b1515bf..4f4ac7d8a 100644 --- a/features/integration_with_rspec.feature +++ b/features/integration_with_rspec.feature @@ -9,7 +9,7 @@ Feature: generate rspec integration tests with application | database_cleaner | Scenario: generate a Rails app, run the generators, and run the tests - When I successfully run `bundle install` + When I install dependencies And I successfully run `bundle exec rails generate rspec:install` And I successfully run `bundle exec rails generate clearance:specs` And I successfully run `bundle exec rails generate clearance:install` diff --git a/features/integration_with_test_unit.feature b/features/integration_with_test_unit.feature index aa95c2f20..6b98238fd 100644 --- a/features/integration_with_test_unit.feature +++ b/features/integration_with_test_unit.feature @@ -7,7 +7,7 @@ Feature: integrate with test-unit | cucumber-rails | Scenario: generate a Rails app, run the generators, and run the tests - When I successfully run `bundle install` + When I install dependencies And I successfully run `bundle exec rails generate clearance:install` And I successfully run `bundle exec rake db:migrate` And I successfully run `bundle exec rails generate controller posts index` diff --git a/features/step_definitions/configuration_steps.rb b/features/step_definitions/configuration_steps.rb index b307d1206..162f4214c 100644 --- a/features/step_definitions/configuration_steps.rb +++ b/features/step_definitions/configuration_steps.rb @@ -1,3 +1,7 @@ +When /^I install dependencies$/ do + step "I successfully run `bundle install --local`" +end + When "I have a project with clearance and the following gems:" do |table| step "I have a project with clearance" @@ -8,7 +12,7 @@ When "I have a project with clearance" do Bundler.with_original_env do - step "I successfully run `bundle exec rails new testapp --skip-bundle`" + step "I successfully run `bundle exec rails new testapp --skip-bundle --skip-javascript --skip-sprockets`" end steps %Q{ @@ -17,6 +21,7 @@ And I remove the file "app/views/layouts/application.html.erb" And I configure ActionMailer to use "localhost" as a host And I configure a root route + And I remove the "turn" gem from this project And I add the "clearance" gem from this project } end diff --git a/features/step_definitions/gem_file_steps.rb b/features/step_definitions/gem_file_steps.rb index a9789bbfa..178c37325 100644 --- a/features/step_definitions/gem_file_steps.rb +++ b/features/step_definitions/gem_file_steps.rb @@ -5,3 +5,11 @@ When /^I add the "([^"]*)" gem from this project$/ do |gem_name| append_to_file('Gemfile', %{\ngem "#{gem_name}", :path => "../../.."\n}) end + +When /^I remove the "([^"]*)" gem from this project$/ do |gem_name| + in_current_dir do + content = File.read('Gemfile') + content.gsub!(/^.*gem 'turn'.*\n/, '') + File.open('Gemfile', 'w') { |file| file.write(content) } + end +end diff --git a/gemfiles/3.0.20.gemfile.lock b/gemfiles/3.0.20.gemfile.lock index 74f6e8bb5..dfdad1f74 100644 --- a/gemfiles/3.0.20.gemfile.lock +++ b/gemfiles/3.0.20.gemfile.lock @@ -36,6 +36,7 @@ GEM activemodel (= 3.0.20) activesupport (= 3.0.20) activesupport (3.0.20) + ansi (1.4.3) appraisal (0.4.1) bundler rake @@ -90,6 +91,7 @@ GEM treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.19) + minitest (4.7.0) mocha (0.13.0) metaclass (~> 0.0.1) multi_json (1.5.0) @@ -147,6 +149,8 @@ GEM treetop (1.4.12) polyglot polyglot (>= 0.3.1) + turn (0.9.6) + ansi tzinfo (0.3.35) websocket (1.0.7) xpath (0.1.4) @@ -165,9 +169,11 @@ DEPENDENCIES cucumber-rails (= 1.1.1) database_cleaner (= 0.8.0) factory_girl_rails (= 3.5.0) + minitest (~> 4.7.0) psych (~> 1.3.4) rails (= 3.0.20) rspec-rails (= 2.12.2) shoulda-matchers (= 1.2.0) sqlite3 (= 1.3.6) timecop (= 0.3.5) + turn (~> 0.9.6) diff --git a/gemfiles/3.1.11.gemfile.lock b/gemfiles/3.1.11.gemfile.lock index d25477b7d..7166decd8 100644 --- a/gemfiles/3.1.11.gemfile.lock +++ b/gemfiles/3.1.11.gemfile.lock @@ -90,6 +90,7 @@ GEM treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.21) + minitest (4.7.0) mocha (0.13.0) metaclass (~> 0.0.1) multi_json (1.6.0) @@ -175,6 +176,7 @@ DEPENDENCIES cucumber-rails (= 1.1.1) database_cleaner (= 0.8.0) factory_girl_rails (= 3.5.0) + minitest (~> 4.7.0) psych (~> 1.3.4) rails (= 3.1.11) rspec-rails (= 2.12.2) diff --git a/gemfiles/3.2.12.gemfile.lock b/gemfiles/3.2.12.gemfile.lock index 8109c3967..a1a67a725 100644 --- a/gemfiles/3.2.12.gemfile.lock +++ b/gemfiles/3.2.12.gemfile.lock @@ -36,6 +36,7 @@ GEM activesupport (3.2.12) i18n (~> 0.6) multi_json (~> 1.0) + ansi (1.4.3) appraisal (0.4.1) bundler rake @@ -90,6 +91,7 @@ GEM treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.21) + minitest (4.7.0) mocha (0.13.0) metaclass (~> 0.0.1) multi_json (1.6.0) @@ -156,6 +158,8 @@ GEM treetop (1.4.12) polyglot polyglot (>= 0.3.1) + turn (0.9.6) + ansi tzinfo (0.3.35) websocket (1.0.7) xpath (0.1.4) @@ -174,9 +178,11 @@ DEPENDENCIES cucumber-rails (= 1.1.1) database_cleaner (= 0.8.0) factory_girl_rails (= 3.5.0) + minitest (~> 4.7.0) psych (~> 1.3.4) rails (= 3.2.12) rspec-rails (= 2.12.2) shoulda-matchers (= 1.2.0) sqlite3 (= 1.3.6) timecop (= 0.3.5) + turn (~> 0.9.6)