spdx-licenses 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,27 @@
1
+ $LOAD_PATH << File.expand_path('../../lib', __FILE__)
2
+
3
+ require 'test/unit'
4
+ require 'mocha/test_unit'
5
+ require 'spdx-licenses/license'
6
+
7
+ class TestLicense < Test::Unit::TestCase
8
+ def setup
9
+ @license = SpdxLicenses::License.new('Apache-2.0', 'Apache License 2.0', true)
10
+ end
11
+
12
+ def test_id
13
+ assert_equal 'Apache-2.0', @license.id
14
+ end
15
+
16
+ def test_name
17
+ assert_equal 'Apache License 2.0', @license.name
18
+ end
19
+
20
+ def test_osi_approved
21
+ assert_equal true, @license.osi_approved
22
+ end
23
+
24
+ def test_osi_approved?
25
+ assert_equal true, @license.osi_approved?
26
+ end
27
+ end
@@ -0,0 +1,28 @@
1
+ $LOAD_PATH << File.expand_path('../../lib', __FILE__)
2
+
3
+ require 'test/unit'
4
+ require 'mocha/test_unit'
5
+ require 'spdx-licenses'
6
+
7
+ class TestSpdxLicenses < Test::Unit::TestCase
8
+ def test_exist_unknown
9
+ assert_equal false, SpdxLicenses.exist?('unknown')
10
+ end
11
+
12
+ def test_exist_known
13
+ assert_equal true, SpdxLicenses.exist?('Apache-2.0')
14
+ end
15
+
16
+ def test_lookup_unknown
17
+ assert_nil SpdxLicenses.lookup('unknown')
18
+ end
19
+
20
+ def test_lookup_known
21
+ SpdxLicenses::License.expects(:new).with('Apache-2.0', 'Apache License 2.0', true).returns('license')
22
+ assert_equal 'license', SpdxLicenses.lookup('Apache-2.0')
23
+ end
24
+
25
+ def test_version
26
+ assert_equal SpdxLicenses::VERSION, SpdxLicenses.version
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spdx-licenses
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Dominic Cleal
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Provides validation and additional data about SPDX licenses and identifiers
28
+ email: dominic@cleal.org
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - LICENSE
34
+ - README.md
35
+ - Rakefile
36
+ - lib/spdx-licenses.rb
37
+ - lib/spdx-licenses/license.rb
38
+ - lib/spdx-licenses/version.rb
39
+ - spdx.json
40
+ - test/license_test.rb
41
+ - test/spdx_licenses_test.rb
42
+ homepage: https://github.com/domcleal/spdx-licenses
43
+ licenses:
44
+ - MIT
45
+ metadata: {}
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.2.2
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: SPDX license and identifier lookup
66
+ test_files: []