2010-01-28 15:30:18 +00:00
|
|
|
require File.join(File.dirname(__FILE__), 'test_helper')
|
2010-01-26 20:31:03 +00:00
|
|
|
|
2010-01-28 15:30:18 +00:00
|
|
|
class SSHTest < Test::Unit::TestCase
|
2010-02-05 20:54:48 +00:00
|
|
|
should "be able to execute a command over ssh" do
|
|
|
|
ssh = Hydra::SSH.new(
|
|
|
|
'localhost', # connect to this machine
|
|
|
|
File.expand_path(File.join(File.dirname(__FILE__))), # move to the test directory
|
|
|
|
"ruby fixtures/echo_the_dolphin.rb"
|
|
|
|
)
|
|
|
|
message = Hydra::Messages::TestMessage.new
|
|
|
|
ssh.write message
|
|
|
|
assert_equal message.text, ssh.gets.text
|
|
|
|
ssh.close
|
2010-01-26 20:31:03 +00:00
|
|
|
end
|
|
|
|
end
|