foodcritic-junit 0.1.5 → 0.1.6

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: a0f7a26777b21411625583b1757dac376ae70e6a
4
- data.tar.gz: 1ddb79448fe00760f8faaef81d005fd10fdfce61
3
+ metadata.gz: a3c5023726931552afcfb5475468cbb5b99fd78b
4
+ data.tar.gz: 82910a0f5e7bf374c0fc6b9e35877c5f63b21413
5
5
  SHA512:
6
- metadata.gz: 032578005442d3f7d530868df65dfa39551e910a193ab37450d089f808a4c7ccbfafa776fff9bbb0a0c19ad6d3c133d9a766c27ec16578b250011d8fb851aa85
7
- data.tar.gz: 81678487786ce326b1eb59ccc28d1c29f8ff3133b3bded557bad9fe9ad9e0be487e013375023fd1fb3948a6dd9c23251e0c58f739131fc58932d6806e2cabc5f
6
+ metadata.gz: c5c0c319a0f5e5f0c2164ca3d46f0f369254c31b360a7407ed1f7084e8e961d2c39fb227f05f613224465d73f12c84f001dbac7244a1acc171a45f022fdd386b
7
+ data.tar.gz: 70d41c66aa38dafa600ce94ecc62c363fc19dd289c23e568815f2e1412d30030ace0cb1c695bb32525730d7cc9f38784d39135661b93c5e89534828ccc0e26fd
@@ -45,7 +45,7 @@ module Foodcritic
45
45
  @current_violation = violation
46
46
  @current_violation_lines = []
47
47
  else
48
- current_violation_lines << line.encode(xml: :attr) if current_violation_lines
48
+ current_violation_lines << line if current_violation_lines
49
49
  end
50
50
  end
51
51
  end
@@ -64,7 +64,7 @@ module Foodcritic
64
64
  <<-EOS
65
65
  <?xml version="1.0" encoding="UTF-8"?>
66
66
  <testsuites>
67
- <testsuite name="#{cookbook_name}" timestamp="#{Time.now.utc.iso8601}">
67
+ <testsuite name=#{cookbook_name.encode(xml: :attr)} timestamp=#{Time.now.utc.iso8601.to_s.encode(xml: :attr)}>
68
68
  #{violations_as_xml}
69
69
  </testsuite>
70
70
  </testsuites>
@@ -80,12 +80,13 @@ module Foodcritic
80
80
  end
81
81
 
82
82
  def xml_for_violation(violation)
83
- name = "#{violation[:rule]}: #{violation[:message]}"
84
- file_name = violation[:file_name]
83
+ name = "#{violation[:rule]}: #{violation[:message]}".encode(xml: :attr)
84
+ file_name = violation[:file_name].encode(xml: :attr)
85
+ location = "Located in #{violation[:file_name]}".encode(xml: :attr)
85
86
  <<-EOS
86
- <testcase name="#{name}" classname="#{file_name}" assertions="0" time="0">
87
- <error type="#{name}" message="Located in #{file_name}">
88
- #{violation[:lines]}
87
+ <testcase name=#{name} classname=#{file_name} assertions="0" time="0">
88
+ <error type=#{name} message=#{location}>
89
+ #{violation[:lines].encode(xml: :text)}
89
90
  </error>
90
91
  </testcase>
91
92
  EOS
@@ -1,5 +1,5 @@
1
1
  module Foodcritic
2
2
  module Junit
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foodcritic-junit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Vendetta