From 574b5f7350c480f367b7d06cc645d39c9ad84c3f Mon Sep 17 00:00:00 2001 From: Nick Gauthier Date: Sat, 6 Feb 2010 16:23:52 -0500 Subject: [PATCH] replaced echo script with hello script for ssh testing. --- test/fixtures/echo_the_dolphin.rb | 7 ------- test/fixtures/hello_world.rb | 3 +++ test/ssh_test.rb | 7 +++---- 3 files changed, 6 insertions(+), 11 deletions(-) delete mode 100755 test/fixtures/echo_the_dolphin.rb create mode 100644 test/fixtures/hello_world.rb diff --git a/test/fixtures/echo_the_dolphin.rb b/test/fixtures/echo_the_dolphin.rb deleted file mode 100755 index f4e5356..0000000 --- a/test/fixtures/echo_the_dolphin.rb +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env ruby -# Echoes back to the sender -$stdout.sync = true -while line = $stdin.get - $stdout.write line -end - diff --git a/test/fixtures/hello_world.rb b/test/fixtures/hello_world.rb new file mode 100644 index 0000000..ae056f3 --- /dev/null +++ b/test/fixtures/hello_world.rb @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +$stdout.write "{:class=>Hydra::Messages::TestMessage, :text=>\"Hello World\"}\n" +$stdout.flush diff --git a/test/ssh_test.rb b/test/ssh_test.rb index e197254..6b0ee40 100644 --- a/test/ssh_test.rb +++ b/test/ssh_test.rb @@ -5,11 +5,10 @@ class SSHTest < Test::Unit::TestCase 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" + "ruby fixtures/hello_world.rb" ) - message = Hydra::Messages::TestMessage.new - ssh.write message - assert_equal message.text, ssh.gets.text + response = ssh.gets + assert_equal "Hello World", response.text ssh.close end end