Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix nil to_xs with CI_CAPTURE=off #48

Merged
merged 1 commit into from

2 participants

@seanwalbran

A fix for the below issue, seen when setting the environment variable CI_CAPTURE=off:

1) TestSuite xml should render successfully with CI_CAPTURE off
Failure/Error: xml = @suite.to_xml
NoMethodError:
undefined method to_xs' for nil:NilClass
# ./lib/ci/reporter/test_suite.rb:89:in
to_xml'
# ./lib/ci/reporter/test_suite.rb:88:in to_xml'
# ./lib/ci/reporter/test_suite.rb:84:in
to_xml'
# ./spec/ci/reporter/test_suite_spec.rb:71

@nicksieger nicksieger merged commit 31895dc into ci-reporter:master
@nicksieger
Owner

Thank you sir! Nice to see you here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 14, 2011
  1. @seanwalbran
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.