danger-junit 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58c923a604963a4621a2ba5bd2034933df54b684
4
- data.tar.gz: eddcbb189a7161a39db64ea1ee95d6c3a4303229
3
+ metadata.gz: 11c90a8c04d958031389e06046851da0bd340567
4
+ data.tar.gz: 630cad02ddbee1575b42f9a586d9a458367e0693
5
5
  SHA512:
6
- metadata.gz: 89f9ba58e802a44f84c1e0a5a0002ebd19d1982b09ea2c29d23a713f96016de2f227efe069dfa91a55a0fd465f2ceffad94ded81c8d757b729dcadbcb972af71
7
- data.tar.gz: bb4a172c51a0277c9be1da381faba9e3ffbf7bf61afd8eb574f42db9787133b02ac2703099f4bcaca42dd53523a428475f7b38b31294dcbbb5707ad9ba01b75d
6
+ metadata.gz: d9d8f576d975c6b96a998dfc46c0a56814c75b27bc43aa101e904026c652222e78845c2fec4475c16bce439d9602ceb89ff00268bf3154a32dcf03628b1951d1
7
+ data.tar.gz: 3d91dbab3426cd94525eb05cd004145a21da9408887a8fead38ddc3f21676fad20d94bc4646ec1cb63333086378ebf0e4cf83e3f8545f8722fd04ce5db7e24d6
@@ -1,3 +1,3 @@
1
1
  module Junit
2
- VERSION = '0.7.2'.freeze
2
+ VERSION = '0.7.3'.freeze
3
3
  end
@@ -92,10 +92,10 @@ module Danger
92
92
  @doc = Ox.parse(xml_string)
93
93
 
94
94
  suite_root = @doc.nodes.first.value == 'testsuites' ? @doc.nodes.first : @doc
95
- @tests = suite_root.nodes.map(&:nodes).flatten.select { |node| node.value == 'testcase' }
95
+ @tests = suite_root.nodes.map(&:nodes).flatten.select { |node| node.kind_of?(Ox::Element) && node.value == 'testcase' }
96
96
 
97
97
  failed_suites = suite_root.nodes.select { |suite| suite[:failures].to_i > 0 || suite[:errors].to_i > 0 }
98
- failed_tests = failed_suites.map(&:nodes).flatten.select { |node| node.value == 'testcase' }
98
+ failed_tests = failed_suites.map(&:nodes).flatten.select { |node| node.kind_of?(Ox::Element) && node.value == 'testcase' }
99
99
 
100
100
  @failures = failed_tests.select do |test|
101
101
  test.nodes.count > 0
@@ -1,5 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="2" failures="1">
3
+ <testsuite name="EmptyTests" tests="0" failures="0">
4
+ </testsuite>
3
5
  <testsuite name="ThemojiUITests" tests="2" failures="1">
4
6
  <testcase classname="ThemojiUITests" name="testExample()">
5
7
  </testcase>
@@ -8,4 +10,4 @@
8
10
  </failure>
9
11
  </testcase>
10
12
  </testsuite>
11
- </testsuites>
13
+ </testsuites>
@@ -55,7 +55,7 @@ module Danger
55
55
 
56
56
  output = @junit.status_report[:markdowns].first
57
57
  row = '| Danger::CISource::CircleCI validates when circle all env vars are set | ./spec/lib/danger/ci_sources/circle_spec.rb | 0.012097|'
58
- expect(output).to include(row)
58
+ expect(output.to_s).to include(row)
59
59
  end
60
60
 
61
61
  it 'shows a known markdown row' do
@@ -65,7 +65,7 @@ module Danger
65
65
 
66
66
  output = @junit.status_report[:markdowns].first
67
67
  row = "Time|\n"
68
- expect(output).to include(row)
68
+ expect(output.to_s).to include(row)
69
69
  end
70
70
 
71
71
  it 'shows a warning for skipped' do
@@ -78,14 +78,14 @@ module Danger
78
78
  end
79
79
 
80
80
  it 'links paths that are files' do
81
- allow(@dangerfile.github).to receive(:pr_json).and_return(head: { repo: { html_url: 'https://github.com/thing/thingy' } })
81
+ allow(@dangerfile.github).to receive(:pr_json).and_return('head' => { 'repo' => { 'html_url' => 'https://github.com/thing/thingy' } })
82
82
  allow(@dangerfile.github).to receive(:head_commit).and_return('hello')
83
83
 
84
84
  @junit.parse 'spec/fixtures/danger-junit-fail.xml'
85
85
  @junit.report
86
86
 
87
87
  outputs = @junit.status_report[:markdowns].first
88
- expect(outputs).to include('github.com/thing/thingy')
88
+ expect(outputs.to_s).to include('github.com/thing/thingy')
89
89
  end
90
90
  end
91
91
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-junit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-12 00:00:00.000000000 Z
11
+ date: 2017-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger