mostly working. needs work on IO cleanup

This commit is contained in:
Nick Gauthier 2010-01-27 15:47:50 -05:00
parent b8c7472f5e
commit 2fa15b735b
3 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,10 @@
module Hydra #:nodoc:
class Message #:nodoc:
def initialize(opts = {})
opts.each do |k,v|
self.send(k,v)
end
end
def self.build(hash)
hash.delete(:class).new(hash)
end

View File

@ -2,7 +2,7 @@ module Hydra #:nodoc:
class Runner
def initialize(io)
@io = io
@io.write Hydra::Messages::RunnerRequestsFile.new.serialize
@io.write Hydra::Messages::RunnerRequestsFile.new
end
end
end

View File

@ -11,8 +11,7 @@ class TestRunner < Test::Unit::TestCase
@pipe.identify_as_parent
end
should "request a file on boot" do
@message = Hydra::Message.build(@pipe.gets)
assert @message.is_a?(Hydra::Messages::RunnerRequestsFile)
assert @pipe.gets.is_a?(Hydra::Messages::RunnerRequestsFile)
end
should "return a result message after processing a file" do