Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Using rails_app's Gemfile #130

Open
wants to merge 2 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +2 −0  Rakefile
  2. +4 −2 features/step_definitions/common_steps.rb
View
2  Rakefile
@@ -3,6 +3,8 @@ require 'rake'
require 'cucumber'
require 'cucumber/rake/task'
+include Rake::DSL
+
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format progress"
end
View
6 features/step_definitions/common_steps.rb
@@ -1,5 +1,6 @@
When /^I run "([^\"]*)"$/ do |command|
- system("cd #{@current_directory} && #{command}").should be_true
+ env_vars = command =~ /^rake/ ? "BUNDLE_GEMFILE=#{@current_directory}/Gemfile" : ''
+ system("cd #{@current_directory} && #{env_vars} #{command}").should be_true
end
When /^I add "([^\"]*)" to file "([^\"]*)"$/ do |content, short_path|
@@ -54,7 +55,8 @@
end
Then /^I should successfully run "([^\"]*)"$/ do |command|
- system("cd #{@current_directory} && #{command}").should be_true
+ env_vars = command =~ /^rake/ ? "BUNDLE_GEMFILE=#{@current_directory}/Gemfile" : ''
+ system("cd #{@current_directory} && #{env_vars} #{command}").should be_true
end
Then /^I should see "([^\"]*)" when running "([^\"]*)"$/ do |expected_response, command|
Something went wrong with that request. Please try again.