hydra/test/ssh_test.rb

26 lines
822 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
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/hello_world.rb"
)
response = ssh.gets
assert_equal "Hello World", response.text
ssh.close
2010-01-26 20:31:03 +00:00
end
should "be able to handle a large number of non-Hydra console output" 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/many_outputs_to_console.rb"
)
response = ssh.gets
assert_equal "My message", response.text
ssh.close
end
2010-01-26 20:31:03 +00:00
end