mostly working. needs work on IO cleanup
This commit is contained in:
parent
b8c7472f5e
commit
2fa15b735b
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue