From b51bb8c136387b40b8a65c2a719136147150b3bd Mon Sep 17 00:00:00 2001 From: Arturo Pie Date: Mon, 30 May 2011 13:40:44 -0400 Subject: [PATCH] Some refactoring and added .rvmrc to .gitignore --- .gitignore | 1 + test/master_test.rb | 4 ++-- test/runner_test.rb | 2 +- test/test_helper.rb | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8a5a523..cf7c4c0 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,6 @@ coverage rdoc pkg tags +.rvmrc ## PROJECT::SPECIFIC diff --git a/test/master_test.rb b/test/master_test.rb index ca6091a..e32a183 100644 --- a/test/master_test.rb +++ b/test/master_test.rb @@ -115,8 +115,8 @@ class MasterTest < Test::Unit::TestCase :workers => [{ :type => :ssh, :connect => 'localhost', - :directory => File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')), - :runners => 1 + :directory => remote_dir_path, + :runners => 1 }] ) assert File.exists?(target_file) diff --git a/test/runner_test.rb b/test/runner_test.rb index 7f25acb..96f88ee 100644 --- a/test/runner_test.rb +++ b/test/runner_test.rb @@ -98,7 +98,7 @@ class RunnerTest < Test::Unit::TestCase should "be able to run a runner over ssh" do ssh = Hydra::SSH.new( 'localhost', - File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')), + remote_dir_path, "ruby -e \"require 'rubygems'; require 'hydra'; Hydra::Runner.new(:io => Hydra::Stdio.new, :verbose => true);\"" ) assert ssh.gets.is_a?(Hydra::Messages::Runner::RequestFile) diff --git a/test/test_helper.rb b/test/test_helper.rb index a482fc0..4d7c6d2 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -56,6 +56,10 @@ class Test::Unit::TestCase def conflicting_test_file File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'conflicting.rb')) end + + def remote_dir_path + File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')) + end end module Hydra #:nodoc: