lib/test_runner.rb in trafficbroker-mandy-0.1.7 vs lib/test_runner.rb in trafficbroker-mandy-0.1.8
- old
+ new
@@ -6,18 +6,18 @@
@job = Mandy::Job.find_by_name(job)
end
def map(input_stream, output_stream=StringIO.new(''), &blk)
input_stream = input_from_array(input_stream) if input_stream.is_a?(Array)
- input_stream = StringIO.new(input_stream.to_s) unless input_stream.is_a?(StringIO)
+ input_stream = StringIO.new(input_stream) if input_stream.is_a?(String)
@job.run_map(input_stream, output_stream, &blk)
output_stream.rewind
output_stream
end
def reduce(input_stream, output_stream=StringIO.new(''), &blk)
input_stream = input_from_hash(input_stream) if input_stream.is_a?(Hash)
- input_stream = StringIO.new(input_stream.to_s) unless input_stream.is_a?(StringIO)
+ input_stream = StringIO.new(input_stream) if input_stream.is_a?(String)
@job.run_reduce(input_stream, output_stream, &blk)
output_stream.rewind
output_stream
end
\ No newline at end of file