Permalink
Browse files

made integration tests work

  • Loading branch information...
1 parent 87ff9e9 commit eac5886f8fe024f8a906908a2ba99387593720ba @reactormonk committed Oct 6, 2010
Showing with 3 additions and 5 deletions.
  1. +3 −5 integration/setup.rb
View
8 integration/setup.rb
@@ -2,16 +2,14 @@
require 'tmpdir'
require 'ostruct'
require 'fileutils'
-require 'shellwords'
-$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
-require 'project'
require 'ruby-debug'
shared :integration do
class << self
root = File.join(File.dirname(__FILE__), '..')
bin_path = File.join(root, 'bin', 'project')
+ bin = ['ruby', '-I', File.join(root, 'lib'), '--', bin_path].join(' ')
tmp = File.join('/tmp', 'project', 'integration')
# Bit bulky of a method. Runs the bin_path in a tmpdir.
@@ -27,15 +25,15 @@ class << self
config and File.open('config.yaml', 'w') {|file| file.write config.to_yaml}
block.call if block
- result.stdout = run_command(bin_path, '--config', 'config.yaml', *args)
+ result.stdout = run_command(bin, '--config', 'config.yaml', *args)
File.exist?('config.yaml') and result.config = YAML::load_file('config.yaml')
end
end
result
end
def run_command(*command)
- io = IO.popen(Shellwords::shelljoin(command))
+ io = IO.popen(command.join(' '))
result = []
until io.none?
result << io.read

0 comments on commit eac5886

Please sign in to comment.