Permalink
Browse files

Fixed bug where back-tick system calls where failing.

When making a system call using back-ticks, eg: /Users/brendanboesen/Documents/projects/ci_reporter, the call was failing because  was set to nil.
This turned out to be a bug in the initialization of the Delegate where the delegate instance (currently nil) was passed to the 'assign' block instead of the captured IO stream.
  • Loading branch information...
1 parent 20153f8 commit 9dfda81534c37df4d41f7d72665b28961a6c2db6 Brendan Boesen committed Apr 26, 2012
Showing with 8 additions and 1 deletion.
  1. +1 −1 lib/ci/reporter/test_suite.rb
  2. +7 −0 spec/ci/reporter/output_capture_spec.rb
@@ -29,7 +29,7 @@ def capture(io, &assign)
@delegate_io = io
@captured_io = StringIO.new
@assign_block = assign
- @assign_block.call self
+ @assign_block.call @captured_io
end
# Finalize the capture and reset to the original IO object.
@@ -54,4 +54,11 @@
@suite.stdout.should == "B"
@suite.stderr.should == "B"
end
+
+ it "should not barf when commands are executed with back-ticks" do
+ @suite.start
+ `echo "B"`
+ @suite.finish
+ end
+
end

0 comments on commit 9dfda81

Please sign in to comment.