minitest-ci 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/minitest/ci.rb CHANGED
@@ -31,7 +31,7 @@ module MiniTest
31
31
  ###
32
32
  CI_MINI_DIR = File.dirname(File.dirname(file))
33
33
 
34
- VERSION = '1.0.3'
34
+ VERSION = '1.0.4'
35
35
 
36
36
  @test_dir = nil #'test/reports'
37
37
  @error = nil
@@ -120,7 +120,7 @@ module MiniTest
120
120
  f.puts " <testcase time='#{"%6f" % time}' name='#{method}' assertions='#{asserts}'>"
121
121
  if error
122
122
  bt = filter_backtrace(error.backtrace).join "\n"
123
- f.write " <#{type error} type='#{escape error.class}' message='#{escape error.message}'>"
123
+ f.write " <#{type error} type='#{escape error.class}' message=#{escape( error.message ).inspect}>"
124
124
  f.puts escape bt
125
125
  f.puts " </#{type error}>"
126
126
  end
@@ -27,6 +27,10 @@ class MockTestSuite < MiniTest::Unit::TestCase
27
27
  def test_invalid_error_name
28
28
  raise Class.new(Exception)
29
29
  end
30
+
31
+ def test_escaping_failure_message
32
+ flunk "failed: doesn't like single or \"double\" quotes or symbols such as <"
33
+ end
30
34
  end
31
35
 
32
36
  class TestMinitest
@@ -61,15 +65,15 @@ class TestMinitest::TestCi < MiniTest::Unit::TestCase
61
65
 
62
66
  def test_testsuite
63
67
  assert_equal "1", @doc['skipped']
64
- assert_equal "1", @doc['failures']
68
+ assert_equal "2", @doc['failures']
65
69
  assert_equal "4", @doc['errors']
66
- assert_equal "2", @doc['assertions']
67
- assert_equal "6", @doc['tests']
70
+ assert_equal "3", @doc['assertions']
71
+ assert_equal "7", @doc['tests']
68
72
  assert_equal "MockTestSuite", @doc['name']
69
73
  end
70
74
 
71
75
  def test_testcase
72
- assert_equal 6, @doc.children.count {|c| Nokogiri::XML::Element === c}
76
+ assert_equal 7, @doc.children.count {|c| Nokogiri::XML::Element === c}
73
77
  @doc.children.each do |c|
74
78
  next unless Nokogiri::XML::Element === c
75
79
  assert_equal 'testcase', c.name
@@ -98,6 +102,11 @@ class TestMinitest::TestCi < MiniTest::Unit::TestCase
98
102
  error = @doc.at_xpath('/testsuite/testcase[@name="test_invalid_error_name"]')
99
103
  assert_match( /^#<Class/, error.at_xpath('failure')['message'] )
100
104
  assert_equal '0', error['assertions']
105
+
106
+ error = @doc.at_xpath('/testsuite/testcase[@name="test_escaping_failure_message"]')
107
+ msg = "failed: doesn't like single or \"double\" quotes or symbols such as <"
108
+ assert_equal msg, error.at_xpath('failure')['message']
109
+ assert_equal '1', error['assertions']
101
110
  end
102
111
 
103
112
  def test_output
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: minitest-ci
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.3
5
+ version: 1.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Brian Henderson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-10-04 00:00:00 Z
13
+ date: 2011-10-17 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: minitest
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  requirements: []
104
104
 
105
105
  rubyforge_project: minitest-ci
106
- rubygems_version: 1.8.10
106
+ rubygems_version: 1.8.11
107
107
  signing_key:
108
108
  specification_version: 3
109
109
  summary: CI reporter plugin for MiniTest This gem was made possible by ATT Interactive.