Skip to content

Commit

Permalink
Make sure the generated app uses the same versions as the project's G…
Browse files Browse the repository at this point in the history
…emfile
  • Loading branch information
jferris committed Jun 2, 2011
1 parent da7a76a commit 38c89a2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
21 changes: 11 additions & 10 deletions features/integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
Feature: integrate with application

Background:
When I successfully run "rails new testapp"
When I successfully run "bundle exec rails new testapp"
And I cd to "testapp"
And I copy the locked Gemfile from this project
And I remove the file "public/index.html"
And I remove the file "app/views/layouts/application.html.erb"
And I configure ActionMailer to use "localhost" as a host
Expand All @@ -17,15 +18,15 @@ Feature: integrate with application
And I add the "clearance" gem from this project
And I add the "diesel" gem
And I run "bundle install --local"
And I successfully run "rails generate cucumber:install"
And I successfully run "bundle exec rails generate cucumber:install"
And I disable Capybara Javascript emulation
And I successfully run "rails generate clearance:features"
And I successfully run "bundle exec rails generate clearance:features"

Scenario: generate a Rails app, run the generators, and run the tests
When I successfully run "rails generate clearance:install"
When I successfully run "bundle exec rails generate clearance:install"
Then the output should contain "Next steps"
When I successfully run "rake db:migrate --trace"
And I successfully run "rake --trace"
When I successfully run "bundle exec rake db:migrate --trace"
And I successfully run "bundle exec rake --trace"
Then the output should contain "passed"
And the output should not contain "failed"
And the output should not contain "Could not find generator"
Expand All @@ -44,10 +45,10 @@ Feature: integrate with application
end
end
"""
And I successfully run "rake db:migrate --trace"
And I successfully run "rails generate clearance:install"
And I successfully run "rake db:migrate --trace"
And I successfully run "rake --trace"
And I successfully run "bundle exec rake db:migrate --trace"
And I successfully run "bundle exec rails generate clearance:install"
And I successfully run "bundle exec rake db:migrate --trace"
And I successfully run "bundle exec rake --trace"
Then the output should contain "passed"
And the output should not contain "failed"
And the output should not contain "Could not find generator"
Expand Down
5 changes: 5 additions & 0 deletions features/step_definitions/configuration_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ def show
end
end

When /^I copy the locked Gemfile from this project$/ do
in_current_dir do
FileUtils.cp(File.join(PROJECT_ROOT, 'Gemfile.lock'), 'Gemfile.lock')
end
end
2 changes: 1 addition & 1 deletion features/support/env.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ENV["RAILS_ENV"] ||= "test"

PROJECT_ROOT = File.expand_path("../..", __FILE__)
PROJECT_ROOT = File.expand_path("../../..", __FILE__)
$LOAD_PATH << File.join(PROJECT_ROOT, "lib")

require 'rails/all'
Expand Down

0 comments on commit 38c89a2

Please sign in to comment.