Skip to content

Commit

Permalink
Install bundle with --local flag in features
Browse files Browse the repository at this point in the history
* move gem installation to reader-friedly step
* take out turn gem, which causes problems with local installs for CI
  • Loading branch information
Greg Lazarev committed Apr 12, 2013
1 parent 0ff38cb commit e3ced5f
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions clearance.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions features/add_migrations_to_project.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`
Expand All @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion features/integration_with_rspec.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion features/integration_with_test_unit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
7 changes: 6 additions & 1 deletion features/step_definitions/configuration_steps.rb
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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{
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions features/step_definitions/gem_file_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions gemfiles/3.0.20.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
2 changes: 2 additions & 0 deletions gemfiles/3.1.11.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions gemfiles/3.2.12.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit e3ced5f

Please sign in to comment.