Skip to content

Commit

Permalink
Support bundler 1.3 and ruby 2.0 in feature helpers
Browse files Browse the repository at this point in the history
All specs and features pass with ruby 2.0 and bundler 1.3.5
  • Loading branch information
sahilm committed Jul 2, 2013
1 parent 8ac9854 commit 289e966
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ ext/Rakefile
.bundle
TAGS
*.gem
tags
.ruby-version
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
source :gemcutter
source 'https://rubygems.org'
gemspec
gem 'cucumber', '~> 1.0.0'
gem 'rspec', '~> 2.8'
gem 'rake'
gem "spork", :path => File.expand_path("../", __FILE__)

if RUBY_VERSION =~ /^1\.9/
gem 'ruby-debug19'
if RUBY_VERSION =~ /^2\.0|^1\.9/
gem 'debugger'
else
gem 'ruby-debug'
end
28 changes: 8 additions & 20 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@ PATH
specs:
spork (1.0.0rc3)

PATH
remote: .
specs:
spork (1.0.0rc3)

GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
archive-tar-minitar (0.5.2)
builder (3.0.0)
columnize (0.3.6)
cucumber (1.0.6)
Expand All @@ -20,12 +14,16 @@ GEM
gherkin (~> 2.4.18)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
debugger (1.6.0)
columnize (>= 0.3.1)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.2.1)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.3)
diff-lcs (1.1.3)
gherkin (2.4.21)
json (>= 1.4.6)
json (1.6.5)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
rake (0.9.2.2)
rspec (2.8.0)
rspec-core (~> 2.8.0)
Expand All @@ -35,24 +33,14 @@ GEM
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby_core_source (>= 0.1.4)
ruby-debug19 (0.11.6)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
term-ansicolor (1.0.7)

PLATFORMS
ruby

DEPENDENCIES
cucumber (~> 1.0.0)
debugger
rake
rspec (~> 2.8)
ruby-debug19
spork!
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end

task :default => :spec

require 'rake/rdoctask'
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
if File.exist?('VERSION.yml')
require 'yaml'
Expand Down
6 changes: 4 additions & 2 deletions features/support/bundler_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ module BundlerHelpers
extend self
def install_bundle(dir)
Dir.chdir(dir) do
command = "env RUBYOPT= BUNDLE_GEMFILE=Gemfile bundle install"
system(command)
command = "bundle install --gemfile=#{Dir.pwd}/Gemfile --path=#{Dir.pwd}/.bundle"
Bundler.with_clean_env do
system(command)
end
$?.exitstatus
end
end
Expand Down
12 changes: 10 additions & 2 deletions features/support/spork_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,23 @@ def run(command)
stderr_file = Tempfile.new('spork')
stderr_file.close
in_current_dir do
@last_stdout = `env RUBYOPT= bundle exec #{command} 2> #{stderr_file.path}`
gemfile = ENV['BUNDLE_GEMFILE']
Bundler.with_clean_env do
ENV['BUNDLE_GEMFILE'] = gemfile
@last_stdout = `bundle exec #{command} 2> #{stderr_file.path}`
end
@last_exit_status = $?.exitstatus
end
@last_stderr = IO.read(stderr_file.path)
end

def run_in_background(command)
in_current_dir do
@background_job = BackgroundJob.run("env RUBYOPT= bundle exec " + command)
gemfile = ENV['BUNDLE_GEMFILE']
Bundler.with_clean_env do
ENV['BUNDLE_GEMFILE'] = gemfile
@background_job = BackgroundJob.run("bundle exec " + command)
end
end
@background_jobs << @background_job
@background_job
Expand Down

0 comments on commit 289e966

Please sign in to comment.