This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

File.read must perform in the test app directory

  • Loading branch information...
1 parent 2dc7427 commit 6481f8f446fbf3541148405e832d4561b03c3072 @sikachu sikachu committed Feb 11, 2012
Showing with 10 additions and 6 deletions.
  1. +5 −3 features/integration_testing.feature
  2. +5 −3 features/step_definitions/diesel_steps.rb
@@ -150,9 +150,11 @@ Feature: integration testing
end
When /^I comment out gem "([^"]*)" from my Gemfile$/ do |gem_name|
- content = File.read('Gemfile')
- File.open('Gemfile', 'w') do |f|
- f.write content.sub(/gem ['"]#{gem_name}/, '#\1')
+ in_current_dir do
+ content = File.read('Gemfile')
+ File.open('Gemfile', 'w') do |f|
+ f.write content.sub(/gem ['"]#{gem_name}/, '#\1')
+ end
end
end
"""
@@ -16,8 +16,10 @@
end
When /^I comment out gem "([^"]*)" from my Gemfile$/ do |gem_name|
- content = File.read('Gemfile')
- File.open('Gemfile', 'w') do |f|
- f.write content.sub(/gem ['"]#{gem_name}/, '#\1')
+ in_current_dir do
+ content = File.read('Gemfile')
+ File.open('Gemfile', 'w') do |f|
+ f.write content.sub(/gem ['"]#{gem_name}/, '#\1')
+ end
end
end

0 comments on commit 6481f8f

Please sign in to comment.