rspec_junit_formatter_bitbucket 0.2.0.pre.183 → 0.2.0.pre.184

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
  SHA256:
3
- metadata.gz: 6b32f751c5d566b1ba7d753793467d9f973afd22f9dc33867640010b547bcdbb
4
- data.tar.gz: f888a34263fd84f891cbea4cf0d9be6273a0cb593c818c0b4b20c65a3196102f
3
+ metadata.gz: 732405ac58b598dd568c29384523d436c64234955b87d0aa98e5ae040bd50718
4
+ data.tar.gz: 04e5ccd1ebe946bc862b8e003a72d50f7f1fe3805c290534bdd25ae6cbae20cd
5
5
  SHA512:
6
- metadata.gz: 9910fa487fda1bf91af4fe73c6ff06040afdcd493a7770bfd28896bba856c11730af9b81eeab773fc5eca523b83681732458e351a378db372db398cf599f7e1f
7
- data.tar.gz: 77dcfb2d7127394b74e445d6a74a438d8d440d99235db5206fb2043c46f8fdae9debfb44a020db5acf249ec0b1af9e697c023e494ba7b6ec50e17be06a3a2921
6
+ metadata.gz: d3dd286fae44f56c7d91d29791bfe9b6e6dd7ab49a19cc64a7028147e6801034867157616c504d9c30be3fb782e6d3632419d4bb8b5fafc3ea80d28ff279a568
7
+ data.tar.gz: 19d24e27b4c825ca0106b101b972738f2cfff6d368c872986b8f632101922405fced8f0b599668c0becc121b6d5407926ae9726d65f980324d8d9673926c75c4
@@ -7,7 +7,6 @@ module RspecJunitFormatterBitbucket
7
7
  module Format
8
8
  # Inversion of character range from https://www.w3.org/TR/xml/#charsets
9
9
  ILLEGAL_REGEXP = Regexp.new(
10
- =begin
11
10
  '\[\^' \
12
11
  '\u{9}' \
13
12
  '\u{a}' \
@@ -16,20 +15,10 @@ module RspecJunitFormatterBitbucket
16
15
  '\u{e000}-\u{fffd}' \
17
16
  '\u{10000}-\u{10ffff}' \
18
17
  '\]'
19
- =end
20
- "[^" <<
21
- "\u{9}" << # => \t
22
- "\u{a}" << # => \n
23
- "\u{d}" << # => \r
24
- "\u{20}-\u{d7ff}" <<
25
- "\u{e000}-\u{fffd}" <<
26
- "\u{10000}-\u{10ffff}" <<
27
- "]"
28
18
  )
29
19
 
30
20
  # Replace illegals with a Ruby-like escape
31
21
  ILLEGAL_REPLACEMENT = Hash.new do |_, c|
32
- =begin
33
22
  x = c.ord
34
23
  if x <= 0xff
35
24
  '\\x%02X'.freeze % x
@@ -38,36 +27,18 @@ module RspecJunitFormatterBitbucket
38
27
  else
39
28
  '\\u{%<X>}'.freeze % x
40
29
  end.freeze
41
- =end
42
- x = c.ord
43
- if x <= 0xff
44
- "\\x%02X".freeze % x
45
- elsif x <= 0xffff
46
- "\\u%04X".freeze % x
47
- else
48
- "\\u{%X}".freeze % x
49
- end.freeze
50
30
  end.update(
51
- =begin
52
31
  "\0".freeze => '\\0'.freeze,
53
32
  "\a".freeze => '\\a'.freeze,
54
33
  "\b".freeze => '\\b'.freeze,
55
34
  "\f".freeze => '\\f'.freeze,
56
35
  "\v".freeze => '\\v'.freeze,
57
36
  "\e".freeze => '\\e'.freeze
58
- =end
59
- "\0".freeze => "\\0".freeze,
60
- "\a".freeze => "\\a".freeze,
61
- "\b".freeze => "\\b".freeze,
62
- "\f".freeze => "\\f".freeze,
63
- "\v".freeze => "\\v".freeze,
64
- "\e".freeze => "\\e".freeze,
65
37
  ).freeze
66
38
 
67
39
  # Discouraged characters from https://www.w3.org/TR/xml/#charsets
68
40
  # Plus special characters with well-known entity replacements
69
41
  DISCOURAGED_REGEXP = Regexp.new(
70
- =begin
71
42
  '[' \
72
43
  '\u{22}' \
73
44
  '\u{26}' \
@@ -94,59 +65,24 @@ module RspecJunitFormatterBitbucket
94
65
  '\u{ffffe}-\u{fffff}' \
95
66
  '\u{10fffe}-\u{10ffff}' \
96
67
  ']'
97
- =end
98
- "[" <<
99
- "\u{22}" << # => "
100
- "\u{26}" << # => &
101
- "\u{27}" << # => '
102
- "\u{3c}" << # => <
103
- "\u{3e}" << # => >
104
- "\u{7f}-\u{84}" <<
105
- "\u{86}-\u{9f}" <<
106
- "\u{fdd0}-\u{fdef}" <<
107
- "\u{1fffe}-\u{1ffff}" <<
108
- "\u{2fffe}-\u{2ffff}" <<
109
- "\u{3fffe}-\u{3ffff}" <<
110
- "\u{4fffe}-\u{4ffff}" <<
111
- "\u{5fffe}-\u{5ffff}" <<
112
- "\u{6fffe}-\u{6ffff}" <<
113
- "\u{7fffe}-\u{7ffff}" <<
114
- "\u{8fffe}-\u{8ffff}" <<
115
- "\u{9fffe}-\u{9ffff}" <<
116
- "\u{afffe}-\u{affff}" <<
117
- "\u{bfffe}-\u{bffff}" <<
118
- "\u{cfffe}-\u{cffff}" <<
119
- "\u{dfffe}-\u{dffff}" <<
120
- "\u{efffe}-\u{effff}" <<
121
- "\u{ffffe}-\u{fffff}" <<
122
- "\u{10fffe}-\u{10ffff}" <<
123
- "]"
124
68
  )
125
69
 
126
70
  # Translate well-known entities, or use generic unicode hex entity
127
71
  DISCOURAGED_REPLACEMENTS = Hash.new do |_, c|
128
72
  "&#x#{c.ord.to_s(16)};".freeze
129
- # "&#x#{c.ord.to_s(16)};".freeze
130
73
  end.update(
131
- =begin
132
74
  '"'.freeze => '&quot;'.freeze,
133
75
  '&'.freeze => '&amp;'.freeze,
134
76
  "'".freeze => '&apos;'.freeze,
135
77
  '<'.freeze => '&lt;'.freeze,
136
78
  '>'.freeze => '&gt;'.freeze
137
- =end
138
- ?".freeze => "&quot;".freeze,
139
- ?&.freeze => "&amp;".freeze,
140
- ?'.freeze => "&apos;".freeze,
141
- ?<.freeze => "&lt;".freeze,
142
- ?>.freeze => "&gt;".freeze,
143
79
  ).freeze
144
80
 
145
81
  def self.escape(text)
146
82
  text.to_s
147
83
  .encode(Encoding::UTF_8)
148
- # .gsub(ILLEGAL_REGEXP, ILLEGAL_REPLACEMENT)
149
- # .gsub(DISCOURAGED_REGEXP, DISCOURAGED_REPLACEMENTS)
84
+ .gsub(ILLEGAL_REGEXP, ILLEGAL_REPLACEMENT)
85
+ .gsub(DISCOURAGED_REGEXP, DISCOURAGED_REPLACEMENTS)
150
86
  end
151
87
 
152
88
  # rubocop:disable Metrics/LineLength
@@ -11,12 +11,12 @@ module RspecJunitFormatterBitbucket
11
11
  end
12
12
 
13
13
  def dump
14
- @output << %(<test-suite #{rm_char_nw_line(testsuite_attr)}>\n)
14
+ @output << %(<testsuite #{rm_char_nw_line(testsuite_attr)}>\n)
15
15
  @output << %(<properties>\n)
16
16
  @output << %(<property #{rm_char_nw_line(property_attr)}/>\n)
17
17
  @output << %(</properties>\n)
18
18
  dump_examples
19
- @output << %(</test-suite>\n)
19
+ @output << %(</testsuite>\n)
20
20
  end
21
21
 
22
22
  private
@@ -73,10 +73,10 @@ module RspecJunitFormatterBitbucket
73
73
  end
74
74
 
75
75
  def dump_example(example)
76
- @output << %(<test-case #{rm_char_nw_line(testcase_attr(example))}>)
76
+ @output << %(<testcase #{rm_char_nw_line(testcase_attr(example))}>)
77
77
  yield if block_given?
78
78
  dump_output(example)
79
- @output << %(</test-case>\n)
79
+ @output << %(</testcase>\n)
80
80
  end
81
81
 
82
82
  def testcase_attr(example)
metadata CHANGED
@@ -1,7 +1,7 @@
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.183
4
+ version: 0.2.0.pre.184
5
5
  platform: ruby
6
6
  authors:
7
7
  - VAILLANT Jeremy