spec/arborist/monitor_spec.rb in arborist-0.0.1.pre20160128152542 vs spec/arborist/monitor_spec.rb in arborist-0.0.1.pre20160606141735
- old
+ new
@@ -24,13 +24,13 @@
end
end
let( :testing_nodes ) {{
- 'trunk' => trunk_node.to_hash,
- 'branch' => branch_node.to_hash,
- 'leaf' => leaf_node.to_hash
+ 'trunk' => trunk_node.to_h,
+ 'branch' => branch_node.to_h,
+ 'leaf' => leaf_node.to_h
}}
it "can be created with just a description" do
mon = described_class.new( "the description" )
@@ -176,9 +176,32 @@
nil
end
mon.run( testing_nodes )
+ end
+
+
+ it "handles system call errors while running the monitor command" do
+ mon = described_class.new( "the description" ) do
+
+ exec 'the_command'
+
+ handle_results {|*| }
+ exec_input {|*| }
+ exec_arguments do |nodes|
+ Loggability[ Arborist ].debug "In the argument-builder."
+ nodes.keys
+ end
+ end
+
+ expect( Process ).to receive( :spawn ) do |*args|
+ raise Errno::EPIPE, "broken pipe"
+ end
+
+ expect {
+ mon.run( testing_nodes )
+ }.to_not raise_error
end
it "can provide a function for providing input to its command" do
mon = described_class.new( "the description" ) do