hydra/test/test_ssh.rb

19 lines
544 B
Ruby
Raw Normal View History

2010-01-26 20:31:03 +00:00
require File.join(File.dirname(__FILE__), 'helper')
class TestSSH < Test::Unit::TestCase
context "an ssh connection" do
setup do
2010-01-27 20:42:53 +00:00
@ssh = Hydra::SSH.new(
'localhost', # connect to this machine
File.expand_path(File.join(File.dirname(__FILE__))), # move to the test directory
"ruby ./echo_the_dolphin.rb"
)
@message = Hydra::Messages::TestMessage.new
2010-01-26 20:31:03 +00:00
end
should "be able to execute a command" do
2010-01-27 20:42:53 +00:00
@ssh.write @message
assert_equal @message.text, @ssh.gets.text
2010-01-26 20:31:03 +00:00
end
end
end