hydra/test/ssh_test.rb

22 lines
597 B
Ruby
Raw Normal View History

require File.join(File.dirname(__FILE__), 'test_helper')
2010-01-26 20:31:03 +00:00
class SSHTest < Test::Unit::TestCase
2010-01-26 20:31:03 +00:00
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