Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #48 from seanwalbran/fix-nil-to-xs-with-capture-off

fix nil to_xs with CI_CAPTURE=off
  • Loading branch information...
commit 31895dc7b74f5dbabd53e9266c0c08ab39485d34 2 parents c801e30 + 55b70f3
@nicksieger nicksieger authored
View
4 lib/ci/reporter/test_suite.rb
@@ -86,10 +86,10 @@ def builder.trunc!(txt)
tc.to_xml(builder)
end
builder.tag! "system-out" do
- builder.text! self.stdout
+ builder.text!(self.stdout || '' )
end
builder.tag! "system-err" do
- builder.text! self.stderr
+ builder.text!(self.stderr || '' )
end
end
end
View
9 spec/ci/reporter/test_suite_spec.rb
@@ -53,6 +53,7 @@ def name.to_s; "object name"; end
describe "TestSuite xml" do
before(:each) do
+ ENV['CI_CAPTURE'] = nil
@suite = CI::Reporter::TestSuite.new("example suite")
@suite.assertions = 11
begin
@@ -62,6 +63,14 @@ def name.to_s; "object name"; end
end
end
+ it "should render successfully with CI_CAPTURE off" do
+ ENV['CI_CAPTURE'] = 'off'
+ @suite.start
+ @suite.testcases << CI::Reporter::TestCase.new("example test")
+ @suite.finish
+ xml = @suite.to_xml
+ end
+
it "should contain Ant/JUnit-formatted description of entire suite" do
failure = mock("failure")
failure.stub!(:failure?).and_return true
Please sign in to comment.
Something went wrong with that request. Please try again.