licensee 9.11.0 → 9.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/bin/licensee +1 -0
  3. data/lib/licensee.rb +4 -2
  4. data/lib/licensee/commands/detect.rb +2 -0
  5. data/lib/licensee/commands/diff.rb +5 -1
  6. data/lib/licensee/commands/license_path.rb +2 -0
  7. data/lib/licensee/commands/version.rb +2 -0
  8. data/lib/licensee/content_helper.rb +20 -10
  9. data/lib/licensee/hash_helper.rb +2 -0
  10. data/lib/licensee/license.rb +2 -0
  11. data/lib/licensee/license_field.rb +2 -0
  12. data/lib/licensee/license_meta.rb +2 -0
  13. data/lib/licensee/license_rules.rb +2 -0
  14. data/lib/licensee/matchers.rb +2 -0
  15. data/lib/licensee/matchers/cabal.rb +15 -1
  16. data/lib/licensee/matchers/cargo.rb +2 -0
  17. data/lib/licensee/matchers/copyright.rb +2 -0
  18. data/lib/licensee/matchers/cran.rb +2 -0
  19. data/lib/licensee/matchers/dice.rb +3 -1
  20. data/lib/licensee/matchers/dist_zilla.rb +2 -0
  21. data/lib/licensee/matchers/exact.rb +2 -0
  22. data/lib/licensee/matchers/gemspec.rb +2 -0
  23. data/lib/licensee/matchers/matcher.rb +2 -0
  24. data/lib/licensee/matchers/npm_bower.rb +2 -0
  25. data/lib/licensee/matchers/package.rb +2 -0
  26. data/lib/licensee/matchers/reference.rb +2 -0
  27. data/lib/licensee/matchers/spdx.rb +2 -0
  28. data/lib/licensee/project_files.rb +2 -0
  29. data/lib/licensee/project_files/license_file.rb +5 -3
  30. data/lib/licensee/project_files/package_manager_file.rb +2 -0
  31. data/lib/licensee/project_files/project_file.rb +11 -4
  32. data/lib/licensee/project_files/readme_file.rb +2 -0
  33. data/lib/licensee/projects.rb +2 -0
  34. data/lib/licensee/projects/fs_project.rb +2 -0
  35. data/lib/licensee/projects/git_project.rb +16 -8
  36. data/lib/licensee/projects/github_project.rb +2 -0
  37. data/lib/licensee/projects/project.rb +4 -2
  38. data/lib/licensee/rule.rb +2 -0
  39. data/lib/licensee/version.rb +3 -1
  40. data/spec/bin_spec.rb +2 -0
  41. data/spec/fixture_spec.rb +46 -0
  42. data/spec/fixtures/detect.json +6 -4
  43. data/spec/fixtures/fixtures.yml +110 -0
  44. data/spec/fixtures/html/license.html +262 -0
  45. data/spec/fixtures/license-hashes.json +30 -27
  46. data/spec/fixtures/mit-optional/LICENSE.txt +21 -0
  47. data/spec/integration_spec.rb +20 -0
  48. data/spec/licensee/commands/detect_spec.rb +5 -1
  49. data/spec/licensee/commands/license_path_spec.rb +2 -0
  50. data/spec/licensee/commands/version_spec.rb +2 -0
  51. data/spec/licensee/content_helper_spec.rb +22 -5
  52. data/spec/licensee/hash_helper_spec.rb +2 -0
  53. data/spec/licensee/license_field_spec.rb +2 -0
  54. data/spec/licensee/license_meta_spec.rb +2 -0
  55. data/spec/licensee/license_rules_spec.rb +2 -0
  56. data/spec/licensee/license_spec.rb +4 -2
  57. data/spec/licensee/matchers/cabal_matcher_spec.rb +93 -0
  58. data/spec/licensee/matchers/cargo_matcher_spec.rb +2 -0
  59. data/spec/licensee/matchers/copyright_matcher_spec.rb +4 -2
  60. data/spec/licensee/matchers/cran_matcher_spec.rb +2 -0
  61. data/spec/licensee/matchers/dice_matcher_spec.rb +2 -0
  62. data/spec/licensee/matchers/dist_zilla_matcher_spec.rb +2 -0
  63. data/spec/licensee/matchers/exact_matcher_spec.rb +2 -0
  64. data/spec/licensee/matchers/gemspec_matcher_spec.rb +2 -0
  65. data/spec/licensee/matchers/matcher_spec.rb +2 -0
  66. data/spec/licensee/matchers/npm_bower_matcher_spec.rb +2 -0
  67. data/spec/licensee/matchers/package_matcher_spec.rb +2 -0
  68. data/spec/licensee/matchers/reference_matcher_spec.rb +2 -0
  69. data/spec/licensee/matchers/spdx_matcher_spec.rb +2 -0
  70. data/spec/licensee/project_files/license_file_spec.rb +3 -1
  71. data/spec/licensee/project_files/package_info_spec.rb +2 -0
  72. data/spec/licensee/project_files/project_file_spec.rb +3 -0
  73. data/spec/licensee/project_files/readme_file_spec.rb +2 -0
  74. data/spec/licensee/project_spec.rb +2 -0
  75. data/spec/licensee/projects/git_project_spec.rb +23 -0
  76. data/spec/licensee/projects/github_project_spec.rb +2 -0
  77. data/spec/licensee/rule_spec.rb +2 -0
  78. data/spec/licensee_spec.rb +3 -1
  79. data/spec/spec_helper.rb +16 -3
  80. data/spec/vendored_license_spec.rb +9 -7
  81. data/vendor/choosealicense.com/_licenses/0bsd.txt +39 -0
  82. data/vendor/choosealicense.com/_licenses/afl-3.0.txt +7 -5
  83. data/vendor/choosealicense.com/_licenses/bsd-3-clause-clear.txt +1 -1
  84. data/vendor/choosealicense.com/_licenses/bsd-3-clause.txt +1 -1
  85. data/vendor/choosealicense.com/_licenses/cecill-2.1.txt +579 -0
  86. data/vendor/choosealicense.com/_licenses/epl-1.0.txt +1 -1
  87. data/vendor/choosealicense.com/_licenses/epl-2.0.txt +1 -1
  88. data/vendor/choosealicense.com/_licenses/odbl-1.0.txt +573 -0
  89. data/vendor/choosealicense.com/_licenses/osl-3.0.txt +1 -1
  90. data/vendor/choosealicense.com/_licenses/unlicense.txt +1 -1
  91. data/vendor/choosealicense.com/_licenses/upl-1.0.txt +3 -3
  92. metadata +40 -18
@@ -1,36 +1,39 @@
1
1
  {
2
- "upl-1.0": "093b8b048dec7bc685c9ee6a5afffa4a1d148c02",
3
- "ofl-1.1": "1fb0563aa1250e18a6948afde286edc95761f461",
4
- "lgpl-3.0": "bdb3c042bd84f914eacfbe4977c5e58352745809",
2
+ "0bsd": "7a6d7180345f015f6aaf49fac3154ed18b7db9ee",
3
+ "afl-3.0": "b991770683c71abd5c8cd8c8f10a03fedcdc76ec",
5
4
  "agpl-3.0": "d445855a1f169b12cbee97d320c2e3522d053016",
6
- "gpl-2.0": "3becd209e8ed8039656c1debe01dd17b9a79208f",
7
- "cc-by-4.0": "899872bc08626e6cf154dcf9e08ff0de82c9b3db",
8
- "ms-rl": "402bf344e506a8d10175c1e516b396c060ffd823",
9
- "wtfpl": "f8544c074f203d86cdcb24082fedfb2cf2fe411a",
10
- "osl-3.0": "ab241ef932d3ac038e8ed62c860e9eba051ae7a0",
5
+ "apache-2.0": "ab3901051663cb8ee5dea9ebdff406ad136910e3",
6
+ "artistic-2.0": "a2ff6e7fb76e51bda9a5350c759a824f206049d1",
7
+ "bsd-2-clause": "59f0099ff04225daf184db3fe55e478256133b1a",
8
+ "bsd-3-clause": "fa22c672927af9c7334874561198799cbf4bdf31",
9
+ "bsd-3-clause-clear": "251d4599b622d2a87b2c4bb21dfacd438c048466",
11
10
  "bsl-1.0": "ca8f916d00c234719956e932061f192abb2d5bf9",
12
- "lgpl-2.1": "91e779a787786276618f58d6e396a5e64a981805",
13
- "mpl-2.0": "b4db668fa7573bfdcae74eb51eafc961034f0a61",
14
- "isc": "d168f98624be864548b2bbf4f198fdbf702d6743",
11
+ "cc-by-4.0": "899872bc08626e6cf154dcf9e08ff0de82c9b3db",
12
+ "cc-by-sa-4.0": "d11590d97684231d5358252e0cc97373d62ec4f1",
15
13
  "cc0-1.0": "ec5027313ed11fea202060f6958ac25b086d6dcb",
16
- "bsd-3-clause-clear": "251d4599b622d2a87b2c4bb21dfacd438c048466",
14
+ "cecill-2.1": "c996e4f8246fddc4fb083f72a70a85f36dffd288",
15
+ "ecl-2.0": "58e7f645bfa1c5ccca7e2c37e626b3487e4d9d1b",
16
+ "epl-1.0": "e306464a81ab0e6688653c6509245b451637172c",
17
+ "epl-2.0": "b57663bc9c3f41446a8cd3f0050149221a58fe66",
18
+ "eupl-1.1": "873e30dbc5f75d076d7aecb6ceb84fb6bb765452",
19
+ "eupl-1.2": "f122f96b9f1a56e4806a89cb1cc6ca2bb956f3e5",
20
+ "gpl-2.0": "3becd209e8ed8039656c1debe01dd17b9a79208f",
17
21
  "gpl-3.0": "b22f1b1f953a38a8a11686587b98831858d6468b",
18
- "unlicense": "86c75861af1b9b9e0573b190dcb2c2cdbbee7037",
19
- "bsd-2-clause": "59f0099ff04225daf184db3fe55e478256133b1a",
20
- "artistic-2.0": "a2ff6e7fb76e51bda9a5350c759a824f206049d1",
21
- "zlib": "576139d1f785b8f3539099b9702fc68005ee2213",
22
+ "isc": "d168f98624be864548b2bbf4f198fdbf702d6743",
23
+ "lgpl-2.1": "91e779a787786276618f58d6e396a5e64a981805",
24
+ "lgpl-3.0": "bdb3c042bd84f914eacfbe4977c5e58352745809",
22
25
  "lppl-1.3c": "60961652297042d28bb689c17fac47eca7348d16",
23
- "epl-2.0": "b57663bc9c3f41446a8cd3f0050149221a58fe66",
24
26
  "mit": "d64f3bb4282a97b37454b5bb96a8a264a3363dc3",
25
- "postgresql": "87550a6bb3409db00d8552b2ac07d373ea56a024",
26
- "afl-3.0": "4702ff33018a2874510beeef5916d6e8629cdc32",
27
- "ncsa": "04c052b69de47ab0641068657a14632cdf9aa48d",
28
- "cc-by-sa-4.0": "d11590d97684231d5358252e0cc97373d62ec4f1",
29
- "bsd-3-clause": "fa22c672927af9c7334874561198799cbf4bdf31",
30
- "epl-1.0": "e306464a81ab0e6688653c6509245b451637172c",
27
+ "mpl-2.0": "b4db668fa7573bfdcae74eb51eafc961034f0a61",
31
28
  "ms-pl": "c900293d66a241e54f7817367a8f32f7f94e12ff",
32
- "ecl-2.0": "58e7f645bfa1c5ccca7e2c37e626b3487e4d9d1b",
33
- "eupl-1.2": "f122f96b9f1a56e4806a89cb1cc6ca2bb956f3e5",
34
- "apache-2.0": "ab3901051663cb8ee5dea9ebdff406ad136910e3",
35
- "eupl-1.1": "873e30dbc5f75d076d7aecb6ceb84fb6bb765452"
29
+ "ms-rl": "402bf344e506a8d10175c1e516b396c060ffd823",
30
+ "ncsa": "04c052b69de47ab0641068657a14632cdf9aa48d",
31
+ "odbl-1.0": "4f4c0884535ebe8fdf1b93d2d3505e323144831f",
32
+ "ofl-1.1": "1fb0563aa1250e18a6948afde286edc95761f461",
33
+ "osl-3.0": "ab241ef932d3ac038e8ed62c860e9eba051ae7a0",
34
+ "postgresql": "87550a6bb3409db00d8552b2ac07d373ea56a024",
35
+ "unlicense": "86c75861af1b9b9e0573b190dcb2c2cdbbee7037",
36
+ "upl-1.0": "554e63fea5b1220601b2d5030a8e1a3f80b59a75",
37
+ "wtfpl": "f8544c074f203d86cdcb24082fedfb2cf2fe411a",
38
+ "zlib": "576139d1f785b8f3539099b9702fc68005ee2213"
36
39
  }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 Ben Balter
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is furnished
10
+ to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice (including the next
13
+ paragraph) shall be included in all copies or substantial portions of the
14
+ Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
19
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
21
+ OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe 'integration test' do
2
4
  [
3
5
  Licensee::Projects::FSProject,
@@ -158,6 +160,15 @@ RSpec.describe 'integration test' do
158
160
  end
159
161
  end
160
162
 
163
+ context 'MIT w/optional phrase' do
164
+ let(:license) { Licensee::License.find('mit') }
165
+ let(:fixture) { 'mit-optional' }
166
+
167
+ it 'returns mit' do
168
+ expect(subject.license).to eql(license)
169
+ end
170
+ end
171
+
161
172
  context 'license + README reference' do
162
173
  let(:license) { Licensee::License.find('mit') }
163
174
  let(:fixture) { 'license-with-readme-reference' }
@@ -195,6 +206,15 @@ RSpec.describe 'integration test' do
195
206
  expect(subject.license).to eql(license)
196
207
  end
197
208
  end
209
+
210
+ context 'HTML license file' do
211
+ let(:license) { Licensee::License.find('epl-1.0') }
212
+ let(:fixture) { 'html' }
213
+
214
+ it 'matches to GPL3' do
215
+ expect(subject.license).to eql(license)
216
+ end
217
+ end
198
218
  end
199
219
 
200
220
  context 'with the license file stubbed' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe 'detect command' do
2
4
  let(:command) { ['bundle', 'exec', 'bin/licensee', 'detect'] }
3
5
  let(:arguments) { [] }
@@ -68,7 +70,9 @@ RSpec.describe 'detect command' do
68
70
  end
69
71
 
70
72
  it 'returns the expected output' do
71
- expect(JSON.parse(stdout)).to eql(expected)
73
+ msg = '`licensee detect --json` output did not match expectations. '.dup
74
+ msg << 'Run `script/dump-detect-json-fixture` and verify the output.'
75
+ expect(JSON.parse(stdout)).to eql(expected), msg
72
76
  end
73
77
  end
74
78
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe 'license-path command' do
2
4
  let(:command) { ['bundle', 'exec', 'bin/licensee', 'license-path'] }
3
5
  let(:arguments) { [project_root] }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe 'version command' do
2
4
  let(:command) { ['bundle', 'exec', 'bin/licensee', 'version'] }
3
5
  let(:arguments) { [] }
@@ -1,15 +1,22 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class ContentHelperTestHelper
2
4
  include Licensee::ContentHelper
3
- attr_accessor :content
5
+ attr_accessor :content, :data
4
6
 
5
- def initialize(content = nil)
7
+ def initialize(content = nil, data = {})
6
8
  @content = content
9
+ @data = data
10
+ end
11
+
12
+ def filename
13
+ @data[:filename]
7
14
  end
8
15
  end
9
16
 
10
17
  RSpec.describe Licensee::ContentHelper do
11
18
  let(:content) do
12
- <<-LICENSE.freeze.gsub(/^\s*/, '')
19
+ <<-LICENSE.gsub(/^\s*/, '')
13
20
  # The MIT License
14
21
  =================
15
22
 
@@ -27,7 +34,8 @@ RSpec.describe Licensee::ContentHelper do
27
34
  -----------
28
35
  LICENSE
29
36
  end
30
- subject { ContentHelperTestHelper.new(content) }
37
+ let(:filename) { 'license.md' }
38
+ subject { ContentHelperTestHelper.new(content, filename: filename) }
31
39
  let(:mit) { Licensee::License.find('mit') }
32
40
  let(:normalized_content) { subject.content_normalized }
33
41
 
@@ -112,6 +120,15 @@ RSpec.describe Licensee::ContentHelper do
112
120
  expect(normalized_content).to eql('foo foo foo foo')
113
121
  end
114
122
  end
123
+
124
+ context 'HTML' do
125
+ let(:content) { '<ul><li>foo</li></ul>' }
126
+ let(:filename) { 'license.html' }
127
+
128
+ it 'strips HTML' do
129
+ expect(normalized_content).to eql('- foo')
130
+ end
131
+ end
115
132
  end
116
133
 
117
134
  context 'integration fixture' do
@@ -171,7 +188,7 @@ RSpec.describe Licensee::ContentHelper do
171
188
  end
172
189
 
173
190
  it 'normalize the content' do
174
- expected = 'the made up license. this license provided "as is". '
191
+ expected = 'the made up license. this license provided "as is". '.dup
175
192
  expected << "please respect the contributors' wishes when implementing "
176
193
  expected << "the license's \"software\"."
177
194
  expect(normalized_content).to eql(expected)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::HashHelper do
2
4
  class HashHelperSpecFixture
3
5
  include Licensee::HashHelper
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::LicenseField do
2
4
  let(:expected_count) { 7 }
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::LicenseMeta do
2
4
  subject { Licensee::License.find('mit').meta }
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::LicenseRules do
2
4
  let(:mit) { Licensee::License.find('mit') }
3
5
  subject { mit.rules }
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::License do
2
- let(:license_count) { 36 }
3
- let(:hidden_license_count) { 24 }
4
+ let(:license_count) { 39 }
5
+ let(:hidden_license_count) { 27 }
4
6
  let(:featured_license_count) { 3 }
5
7
  let(:pseudo_license_count) { 2 }
6
8
  let(:non_featured_license_count) do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::Cabal do
2
4
  let(:content) { 'license: mit' }
3
5
  let(:file) { Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE.txt') }
@@ -27,6 +29,97 @@ RSpec.describe Licensee::Matchers::Cabal do
27
29
  end
28
30
  end
29
31
 
32
+ context 'non-standard license format' do
33
+ let(:content) { "license: #{cabal_license}" }
34
+ context 'GPL-3' do
35
+ let(:cabal_license) { 'GPL-3' }
36
+
37
+ it 'returns GPL-3.0' do
38
+ expect(subject.match).to eql(Licensee::License.find('GPL-3.0'))
39
+ end
40
+ end
41
+
42
+ context 'GPL-2' do
43
+ let(:cabal_license) { 'GPL-2' }
44
+
45
+ it 'returns GPL-2.0' do
46
+ expect(subject.match).to eql(Licensee::License.find('GPL-2.0'))
47
+ end
48
+ end
49
+
50
+ context 'LGPL-2.1' do
51
+ let(:cabal_license) { 'LGPL-2.1' }
52
+
53
+ it 'returns LGPL-2.1' do
54
+ expect(subject.match).to eql(Licensee::License.find('LGPL-2.1'))
55
+ end
56
+ end
57
+
58
+ context 'LGPL-3' do
59
+ let(:cabal_license) { 'LGPL-3' }
60
+
61
+ it 'returns LGPL-3.0' do
62
+ expect(subject.match).to eql(Licensee::License.find('LGPL-3.0'))
63
+ end
64
+ end
65
+
66
+ context 'AGPL-3' do
67
+ let(:cabal_license) { 'AGPL-3' }
68
+
69
+ it 'returns AGPL-3.0' do
70
+ expect(subject.match).to eql(Licensee::License.find('AGPL-3.0'))
71
+ end
72
+ end
73
+
74
+ context 'BSD2' do
75
+ let(:cabal_license) { 'BSD2' }
76
+
77
+ it 'returns BSD-2-Clause' do
78
+ expect(subject.match).to eql(Licensee::License.find('BSD-2-Clause'))
79
+ end
80
+ end
81
+
82
+ context 'BSD3' do
83
+ let(:cabal_license) { 'BSD3' }
84
+
85
+ it 'returns BSD-3-Clause' do
86
+ expect(subject.match).to eql(Licensee::License.find('BSD-3-Clause'))
87
+ end
88
+ end
89
+
90
+ context 'MIT' do
91
+ let(:cabal_license) { 'MIT' }
92
+
93
+ it 'returns MIT' do
94
+ expect(subject.match).to eql(Licensee::License.find('MIT'))
95
+ end
96
+ end
97
+
98
+ context 'ISC' do
99
+ let(:cabal_license) { 'ISC' }
100
+
101
+ it 'returns ISC' do
102
+ expect(subject.match).to eql(Licensee::License.find('ISC'))
103
+ end
104
+ end
105
+
106
+ context 'MPL-2.0' do
107
+ let(:cabal_license) { 'MPL-2.0' }
108
+
109
+ it 'returns MPL-2.0' do
110
+ expect(subject.match).to eql(Licensee::License.find('MPL-2.0'))
111
+ end
112
+ end
113
+
114
+ context 'Apache-2.0' do
115
+ let(:cabal_license) { 'Apache-2.0' }
116
+
117
+ it 'returns Apache-2.0' do
118
+ expect(subject.match).to eql(Licensee::License.find('Apache-2.0'))
119
+ end
120
+ end
121
+ end
122
+
30
123
  context 'no license field' do
31
124
  let(:content) { 'foo: bar' }
32
125
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::Cargo do
2
4
  let(:mit) { Licensee::License.find('mit') }
3
5
  let(:content) { 'license = "MIT"' }
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::Copyright do
2
- let(:content) { 'Copyright 2015 Ben Balter' }
4
+ let(:content) { 'Copyright 2015 Ben Balter'.dup }
3
5
  let(:file) { Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE.txt') }
4
6
  let(:mit) { Licensee::License.find('mit') }
5
7
  let(:no_license) { Licensee::License.find('no-license') }
@@ -28,7 +30,7 @@ RSpec.describe Licensee::Matchers::Copyright do
28
30
  'ASCII-8BIT encoded' => "Copyright \xC2\xA92015 Ben Balter`",
29
31
  'No year' => 'Copyright Ben Balter',
30
32
  'Multiline' => "Copyright Ben Balter\nCopyright Another Entity"
31
- .force_encoding('ASCII-8BIT')
33
+ .dup.force_encoding('ASCII-8BIT')
32
34
  }.each do |description, notice|
33
35
  context "with a #{description} notice" do
34
36
  let(:content) { notice }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::Cran do
2
4
  let(:mit) { Licensee::License.find('mit') }
3
5
  let(:gpl2) { Licensee::License.find('gpl-2.0') }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::Dice do
2
4
  let(:mit) { Licensee::License.find('mit') }
3
5
  let(:gpl) { Licensee::License.find('gpl-3.0') }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::DistZilla do
2
4
  let(:mit) { Licensee::License.find('mit') }
3
5
  let(:content) { 'license = MIT' }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::Exact do
2
4
  let(:mit) { Licensee::License.find('mit') }
3
5
  let(:content) { sub_copyright_info(mit) }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::Gemspec do
2
4
  let(:mit) { Licensee::License.find('mit') }
3
5
  let(:content) { "s.license = 'mit'" }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::Matcher do
2
4
  let(:mit) { Licensee::License.find('mit') }
3
5
  let(:content) { sub_copyright_info(mit) }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::NpmBower do
2
4
  let(:content) { '"license": "mit"' }
3
5
  let(:file) { Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE.txt') }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::Package do
2
4
  let(:mit) { Licensee::License.find('mit') }
3
5
  let(:content) { '' }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Licensee::Matchers::Reference do
2
4
  let(:content) { 'Copyright 2015 Ben Balter' }
3
5
  let(:file) { Licensee::ProjectFiles::LicenseFile.new(content, 'LICENSE.txt') }