Permalink
Browse files

GH #1: Fix output in system-out/system-err

  • Loading branch information...
1 parent dd6cc9e commit a5d3b65ee203507783c175744b9634df022c6597 @nicksieger nicksieger committed Mar 26, 2010
View
5 History.txt
@@ -1,3 +1,8 @@
+== 1.6.2
+
+- GH #1: Properly escape text in system-out and system-err tags (Matt Kanwisher)
+- GH #2: Report rspec before(:all) failures (Edgars Beigarts)
+
== 1.6.1
- Add 'skipped' flag for pending RSpec examples (Aaron Unger)
View
1 acceptance/test_unit_example_test.rb
@@ -3,6 +3,7 @@
class TestUnitExampleTestOne < Test::Unit::TestCase
def test_one
+ puts "Some <![CDATA[on stdout]]>"
assert(false, "First failure")
end
def teardown
View
3 acceptance/verification_spec.rb
@@ -18,6 +18,9 @@
doc.root.attributes["tests"].should == "1"
doc.root.elements.to_a("/testsuite/testcase").size.should == 1
doc.root.elements.to_a("/testsuite/testcase/failure").size.should == 2
+ doc.root.elements.to_a("/testsuite/system-out").first.texts.inject("") do |c,e|
+ c << e.value; c
+ end.strip.should == "Some <![CDATA[on stdout]]>"
end
it "should have no errors or failures for TestUnitExampleTestTwo" do
View
4 lib/ci/reporter/test_suite.rb
@@ -92,10 +92,10 @@ def builder.trunc!(txt)
tc.to_xml(builder)
end
builder.tag! "system-out" do
- builder.cdata! self.stdout
+ builder.text! self.stdout
end
builder.tag! "system-err" do
- builder.cdata! self.stderr
+ builder.text! self.stderr
end
end
end
View
4 spec/ci/reporter/output_capture_spec.rb
@@ -28,8 +28,8 @@
root = REXML::Document.new(@suite.to_xml).root
root.elements.to_a('//system-out').length.should == 1
root.elements.to_a('//system-err').length.should == 1
- root.elements.to_a('//system-out').first.cdatas.first.to_s.should == "Hello\n"
- root.elements.to_a('//system-err').first.cdatas.first.to_s.should == "Hi"
+ root.elements.to_a('//system-out').first.texts.first.to_s.strip.should == "Hello"
+ root.elements.to_a('//system-err').first.texts.first.to_s.strip.should == "Hi"
end
it "should return $stdout and $stderr to original value after finish" do

0 comments on commit a5d3b65

Please sign in to comment.