mostly working. needs work on IO cleanup
This commit is contained in:
parent
b8c7472f5e
commit
2fa15b735b
@ -1,5 +1,10 @@
|
|||||||
module Hydra #:nodoc:
|
module Hydra #:nodoc:
|
||||||
class Message #:nodoc:
|
class Message #:nodoc:
|
||||||
|
def initialize(opts = {})
|
||||||
|
opts.each do |k,v|
|
||||||
|
self.send(k,v)
|
||||||
|
end
|
||||||
|
end
|
||||||
def self.build(hash)
|
def self.build(hash)
|
||||||
hash.delete(:class).new(hash)
|
hash.delete(:class).new(hash)
|
||||||
end
|
end
|
||||||
|
@ -2,7 +2,7 @@ module Hydra #:nodoc:
|
|||||||
class Runner
|
class Runner
|
||||||
def initialize(io)
|
def initialize(io)
|
||||||
@io = io
|
@io = io
|
||||||
@io.write Hydra::Messages::RunnerRequestsFile.new.serialize
|
@io.write Hydra::Messages::RunnerRequestsFile.new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -11,8 +11,7 @@ class TestRunner < Test::Unit::TestCase
|
|||||||
@pipe.identify_as_parent
|
@pipe.identify_as_parent
|
||||||
end
|
end
|
||||||
should "request a file on boot" do
|
should "request a file on boot" do
|
||||||
@message = Hydra::Message.build(@pipe.gets)
|
assert @pipe.gets.is_a?(Hydra::Messages::RunnerRequestsFile)
|
||||||
assert @message.is_a?(Hydra::Messages::RunnerRequestsFile)
|
|
||||||
end
|
end
|
||||||
should "return a result message after processing a file" do
|
should "return a result message after processing a file" do
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user