Permalink
Browse files

Merge branch 'master' of https://github.com/orlanthi/ci_reporter

  • Loading branch information...
2 parents d6fff2f + 9dfda81 commit bb7bb21fe1adad0f021863e74fc8a43218fdca07 @nicksieger nicksieger committed Nov 30, 2012
@@ -30,7 +30,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
@@ -40,10 +40,11 @@
it "should shorten extremely long report filenames" do
reporter = CI::Reporter::ReportManager.new("spec")
suite = mock("test suite")
- suite.should_receive(:name).and_return("some test suite name that goes on and on and on and on and on and on and does not look like it will end any time soon and just when you think it is almost over it just continues to go on and on and on and on and on until it is almost over but wait there is more and then el fin")
+ very_long_name = "some test suite name that goes on and on and on and on and on and on and does not look like it will end any time soon and just when you think it is almost over it just continues to go on and on and on and on and on until it is almost over but wait there is more and then el fin"
+ suite.should_receive(:name).and_return(very_long_name)
suite.should_receive(:to_xml).and_return("<xml></xml>")
reporter.write_report(suite)
- filename = "#{REPORTS_DIR}/SPEC-some-test-suite-name-that-goes-on-and-on-and-on-and-on-and-on-and-on-and-does-not-look-like-it-will-end-any-time-soon-and-just-when-you-think-it-is-almost-over-it-just-continues-t.xml"
+ filename = "#{REPORTS_DIR}/SPEC-#{very_long_name}"[0..CI::Reporter::ReportManager::MAX_FILENAME_SIZE].gsub(/\s/, '-') + ".xml"
File.exist?(filename).should be_true
File.open(filename) {|f| f.read.should == "<xml></xml>"}
end

0 comments on commit bb7bb21

Please sign in to comment.