xcop 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xcop.rb +1 -0
- data/lib/xcop/version.rb +1 -1
- data/test/test_xcop.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0587f8d49aed88e6e268948e67eea7c8ec6557e
|
4
|
+
data.tar.gz: 834e3b41d80ecdaa50d0b1a4357d69009eaeee5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d906e4dee068262203da8a251e7d4f1c225a53793f88f306efe671edc0a142351dc4a5c9d4f6601e994dd60c1064ff7cce9cd6980da857a54e6ecd07304dbee4
|
7
|
+
data.tar.gz: 8b8f1c85855c25586c2d0d41a10e7941f551e560bc987bbb895597f3acdc7cc7c30d7912cc7e29570c344a5366845281faad99fa177e104f99fa5274550b0719
|
data/lib/xcop.rb
CHANGED
data/lib/xcop/version.rb
CHANGED
data/test/test_xcop.rb
CHANGED
@@ -69,4 +69,15 @@ class TestXcop < Minitest::Test
|
|
69
69
|
assert_equal(Xcop::Document.new(f).ldiff(license), '')
|
70
70
|
end
|
71
71
|
end
|
72
|
+
|
73
|
+
def test_removes_previous_license
|
74
|
+
Dir.mktmpdir 'test4' do |dir|
|
75
|
+
f = File.join(dir, 'bad.xml')
|
76
|
+
license = "the license to add\n\n\nhey"
|
77
|
+
File.write(f, '<hello>how do you do?</hello>')
|
78
|
+
Xcop::Document.new(f).fix(license)
|
79
|
+
Xcop::Document.new(f).fix(license)
|
80
|
+
assert_equal(Nokogiri::XML(File.read(f)).xpath('/comment()').length, 1)
|
81
|
+
end
|
82
|
+
end
|
72
83
|
end
|