rspec_junit_formatter_bitbucket 0.2.0.pre.171 → 0.2.0.pre.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36fa8266a5e70f80fb9bf9167fb75852fde80108db7d720233c2c56fc0bdd54d
4
- data.tar.gz: efde650715b6cb878cc8c242975d57568c8e65a58b3a0a1ed9dfaeaba0fdb32c
3
+ metadata.gz: 2c17a7d55f6353d2e514595920b7fe239d67b79b05d6fdd085afd485ce5f4ad8
4
+ data.tar.gz: 372409b6fdb57f6a381f8a26478acfa6427d34f1814e1f421dfc9a43d27ab94f
5
5
  SHA512:
6
- metadata.gz: afacd8bb30e3720feba61c6bc25bdc97e8132b827d890cdb38793ecf85d572ef17904fa77581025a4071af2d048628709490d6e16d24ff10f79c394dc3ceca97
7
- data.tar.gz: 742b32bac104eb4b5ae3eb00ac66a1a6c08298ec10039f4aec44926922933f83a3b3e0008fd58e41ae1eaf107ee53f3c3784e49b1da36f5e118a168d2ec7dd74
6
+ metadata.gz: 68665f173c6b55b32db385298d80a0f1f495da7d4d746c6c242ecfc46b50d4b69cadffc8c6bcec3660fb5d2a0f6fc5b070146c0cfafa53ce4112924aefeb0bf8
7
+ data.tar.gz: 56a186c947543bb8651721e707d094cec5cd1f62675d1465f9685286b1d4bf84a24431b98f22eae9fd67923478f00b297fb45c93aacf7da3e590bbbef0e1f334
@@ -11,12 +11,9 @@ module RspecJunitFormatterBitbucket
11
11
  end
12
12
 
13
13
  def dump
14
- @output << %(<test-suite #{testsuite_attr} >\n)
14
+ @output << %(<test-suite #{rm_char_nw_line(testsuite_attr)} >\n)
15
15
  @output << %(<properties>\n)
16
- @output << %(<property)
17
- @output << %( name="seed")
18
- @output << %( value="#{Format.escape(RSpec.configuration.seed.to_s)}")
19
- @output << %(/>\n)
16
+ @output << %(<property #{rm_char_nw_line(property_attr)} />\n)
20
17
  @output << %(</properties>\n)
21
18
  dump_examples
22
19
  @output << %(</test-suite>\n)
@@ -41,6 +38,13 @@ module RspecJunitFormatterBitbucket
41
38
  TESTSUITE
42
39
  end
43
40
 
41
+ def property_attr
42
+ <<~PROPERTY
43
+ name="seed"
44
+ value="#{Format.escape(RSpec.configuration.seed.to_s)}
45
+ PROPERTY
46
+ end
47
+
44
48
  def dump_examples
45
49
  @test.examples.each do |example|
46
50
  case @test.result_of(example)
@@ -72,9 +76,7 @@ module RspecJunitFormatterBitbucket
72
76
  end
73
77
 
74
78
  def dump_example(example)
75
- @output << %(<test-case )
76
- @output << testcase_attr(example)
77
- @output << %(>)
79
+ @output << %(<test-case #{rm_char_nw_line(testcase_attr(example))} >)
78
80
  yield if block_given?
79
81
  dump_output(example)
80
82
  @output << %(</test-case>\n)
@@ -89,12 +91,16 @@ module RspecJunitFormatterBitbucket
89
91
  TESTCASE
90
92
  end
91
93
 
94
+ def rm_char_nw_line(txt)
95
+ txt.gsub("\n", ' ').gsub("\r", '')
96
+ end
97
+
92
98
  def dump_output(example)
93
99
  stdout = @test.stdout_for(example)
94
- write_stdout(stdout) unless stdout.nil?# && stdout.empty?
100
+ write_stdout(stdout) unless stdout.nil? # && stdout.empty?
95
101
 
96
102
  stderr = @test.stderr_for(example)
97
- write_stderr(stderr) unless stderr.nil?# && stderr.empty?
103
+ write_stderr(stderr) unless stderr.nil? # && stderr.empty?
98
104
  end
99
105
 
100
106
  def write_stdout(stdout)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_junit_formatter_bitbucket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.pre.171
4
+ version: 0.2.0.pre.180
5
5
  platform: ruby
6
6
  authors:
7
7
  - VAILLANT Jeremy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-21 00:00:00.000000000 Z
11
+ date: 2019-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core