hydra/test/test_ssh.rb

22 lines
592 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 fixtures/echo_the_dolphin.rb"
2010-01-27 20:42:53 +00:00
)
@message = Hydra::Messages::TestMessage.new
2010-01-26 20:31:03 +00:00
end
teardown do
@ssh.close
end
2010-01-26 20:31:03 +00:00
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