license_finder 1.2 → 2.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/CHANGELOG.rdoc +27 -0
- data/CONTRIBUTING.md +38 -0
- data/README.md +139 -159
- data/Rakefile +17 -13
- data/features/features/cli_spec.rb +43 -0
- data/features/features/configure/add_dependencies_spec.rb +37 -0
- data/features/features/configure/approve_dependencies_spec.rb +30 -0
- data/features/features/configure/assign_licenses_spec.rb +20 -0
- data/features/features/configure/ignore_dependencies_spec.rb +35 -0
- data/features/features/configure/ignore_groups_spec.rb +31 -0
- data/features/features/configure/name_project_spec.rb +32 -0
- data/features/features/configure/whitelist_licenses_spec.rb +40 -0
- data/features/features/package_managers/bower_spec.rb +14 -0
- data/features/features/package_managers/cocoapods_spec.rb +14 -0
- data/features/features/package_managers/gradle_spec.rb +14 -0
- data/features/features/package_managers/maven_spec.rb +14 -0
- data/features/features/package_managers/npm_spec.rb +14 -0
- data/features/features/package_managers/pip_spec.rb +14 -0
- data/features/features/report/csv_spec.rb +17 -0
- data/features/features/report/html_spec.rb +50 -0
- data/{spec → features}/fixtures/Podfile +0 -0
- data/{spec → features}/fixtures/build.gradle +0 -0
- data/{spec → features}/fixtures/pom.xml +0 -0
- data/features/support/testing_dsl.rb +295 -0
- data/lib/license_finder.rb +16 -50
- data/lib/license_finder/cli.rb +13 -253
- data/lib/license_finder/cli/approvals.rb +26 -0
- data/lib/license_finder/cli/base.rb +20 -0
- data/lib/license_finder/cli/dependencies.rb +39 -0
- data/lib/license_finder/cli/ignored_dependencies.rb +30 -0
- data/lib/license_finder/cli/ignored_groups.rb +30 -0
- data/lib/license_finder/cli/licenses.rb +24 -0
- data/lib/license_finder/cli/main.rb +82 -0
- data/lib/license_finder/cli/makes_decisions.rb +48 -0
- data/lib/license_finder/cli/patched_thor.rb +34 -0
- data/lib/license_finder/cli/project_name.rb +31 -0
- data/lib/license_finder/cli/whitelist.rb +32 -0
- data/lib/license_finder/configuration.rb +14 -145
- data/lib/license_finder/decision_applier.rb +46 -0
- data/lib/license_finder/decisions.rb +174 -0
- data/lib/license_finder/license.rb +13 -32
- data/lib/license_finder/license/definitions.rb +15 -13
- data/lib/license_finder/license/template.rb +1 -1
- data/lib/{data/licenses → license_finder/license/templates}/Apache2.txt +0 -0
- data/lib/{data/licenses → license_finder/license/templates}/BSD.txt +0 -0
- data/lib/{data/licenses → license_finder/license/templates}/GPLv2.txt +0 -0
- data/lib/{data/licenses → license_finder/license/templates}/ISC.txt +0 -0
- data/lib/{data/licenses → license_finder/license/templates}/LGPL.txt +0 -0
- data/lib/{data/licenses → license_finder/license/templates}/MIT.txt +0 -0
- data/lib/{data/licenses → license_finder/license/templates}/NewBSD.txt +0 -0
- data/lib/{data/licenses → license_finder/license/templates}/Python.txt +0 -0
- data/lib/{data/licenses → license_finder/license/templates}/Ruby.txt +0 -0
- data/lib/{data/licenses → license_finder/license/templates}/SimplifiedBSD.txt +0 -0
- data/lib/license_finder/package.rb +77 -7
- data/lib/license_finder/package_manager.rb +43 -0
- data/lib/license_finder/package_managers/bower.rb +1 -1
- data/lib/license_finder/package_managers/bower_package.rb +23 -44
- data/lib/license_finder/package_managers/bundler.rb +4 -7
- data/lib/license_finder/package_managers/bundler_package.rb +14 -31
- data/lib/license_finder/package_managers/cocoa_pods.rb +1 -1
- data/lib/license_finder/package_managers/cocoa_pods_package.rb +2 -10
- data/lib/license_finder/package_managers/gradle.rb +6 -2
- data/lib/license_finder/package_managers/gradle_package.rb +6 -30
- data/lib/license_finder/package_managers/manual_package.rb +25 -0
- data/lib/license_finder/package_managers/maven_package.rb +8 -37
- data/lib/license_finder/package_managers/npm.rb +16 -4
- data/lib/license_finder/package_managers/npm_package.rb +12 -43
- data/lib/license_finder/package_managers/pip_package.rb +17 -37
- data/lib/license_finder/platform.rb +0 -16
- data/lib/license_finder/possible_license_file.rb +9 -14
- data/lib/license_finder/possible_license_files.rb +1 -5
- data/lib/license_finder/report.rb +26 -0
- data/lib/license_finder/reports/csv_report.rb +58 -0
- data/lib/license_finder/reports/erb_report.rb +61 -0
- data/lib/license_finder/reports/html_report.rb +10 -1
- data/lib/license_finder/reports/markdown_report.rb +7 -1
- data/lib/license_finder/reports/templates/bootstrap.css +9 -0
- data/lib/license_finder/reports/templates/html_report.erb +105 -0
- data/lib/{templates → license_finder/reports/templates}/markdown_report.erb +7 -7
- data/lib/license_finder/reports/text_report.rb +5 -3
- data/lib/license_finder/version.rb +3 -0
- data/license_finder.gemspec +2 -6
- data/release/instructions.md +8 -0
- data/spec/feature_helper.rb +11 -0
- data/spec/fixtures/config/license_finder.yml +3 -0
- data/spec/fixtures/{nested_readme/vendor/README → license_directory/LICENSE/Apache.txt} +0 -0
- data/spec/lib/license_finder/cli/approvals_spec.rb +63 -0
- data/spec/lib/license_finder/cli/dependencies_spec.rb +59 -0
- data/spec/lib/license_finder/cli/ignored_dependencies_spec.rb +47 -0
- data/spec/lib/license_finder/cli/ignored_groups_spec.rb +40 -0
- data/spec/lib/license_finder/cli/licenses_spec.rb +60 -0
- data/spec/lib/license_finder/cli/main_spec.rb +110 -0
- data/spec/lib/license_finder/cli/project_name_spec.rb +40 -0
- data/spec/lib/license_finder/cli/whitelist_spec.rb +58 -0
- data/spec/lib/license_finder/configuration_spec.rb +46 -191
- data/spec/lib/license_finder/decision_applier_spec.rb +65 -0
- data/spec/lib/license_finder/decisions_spec.rb +347 -0
- data/spec/lib/license_finder/license/definitions_spec.rb +1 -7
- data/spec/lib/license_finder/license_spec.rb +2 -30
- data/spec/lib/license_finder/package_manager_spec.rb +22 -0
- data/spec/lib/license_finder/package_managers/bower_package_spec.rb +33 -66
- data/spec/lib/license_finder/package_managers/bundler_package_spec.rb +7 -71
- data/spec/lib/license_finder/package_managers/cocoa_pods_package_spec.rb +8 -11
- data/spec/lib/license_finder/package_managers/gradle_package_spec.rb +28 -32
- data/spec/lib/license_finder/package_managers/gradle_spec.rb +18 -23
- data/spec/lib/license_finder/package_managers/maven_package_spec.rb +20 -43
- data/spec/lib/license_finder/package_managers/npm_package_spec.rb +22 -73
- data/spec/lib/license_finder/package_managers/npm_spec.rb +18 -21
- data/spec/lib/license_finder/package_managers/pip_package_spec.rb +24 -63
- data/spec/lib/license_finder/package_spec.rb +121 -0
- data/spec/lib/license_finder/possible_license_file_spec.rb +2 -3
- data/spec/lib/license_finder/possible_license_files_spec.rb +18 -22
- data/spec/lib/license_finder/reports/csv_report_spec.rb +26 -0
- data/spec/lib/license_finder/reports/html_report_spec.rb +39 -22
- data/spec/lib/license_finder/reports/markdown_report_spec.rb +8 -16
- data/spec/lib/license_finder/reports/text_report_spec.rb +21 -12
- data/spec/spec_helper.rb +1 -4
- data/spec/support/shared_examples_for_package.rb +0 -11
- data/spec/support/shared_examples_for_package_manager.rb +1 -0
- data/spec/support/stdout_helpers.rb +4 -11
- metadata +73 -158
- data/db/migrate/201303290935_create_dependencies.rb +0 -14
- data/db/migrate/201303291155_create_licenses.rb +0 -13
- data/db/migrate/201303291402_create_approvals.rb +0 -13
- data/db/migrate/201303291456_create_ancestries.rb +0 -9
- data/db/migrate/201303291519_create_bundler_groups.rb +0 -13
- data/db/migrate/201303291720_move_manual_from_approvals_to_licenses.rb +0 -11
- data/db/migrate/201303291753_allow_null_license_names.rb +0 -7
- data/db/migrate/201304011027_allow_null_dependency_version.rb +0 -7
- data/db/migrate/201304020947_change_table_name_licenses_to_license_aliases.rb +0 -5
- data/db/migrate/201304181524_add_manual_to_dependencies.rb +0 -7
- data/db/migrate/201307250917_add_license_manual_to_dependencies.rb +0 -7
- data/db/migrate/201307251004_data_fix_manual_licenses.rb +0 -15
- data/db/migrate/201307251107_reassociate_license.rb +0 -23
- data/db/migrate/201307251340_remove_manual_from_license_aliases.rb +0 -7
- data/db/migrate/201311192002_add_manually_approved_to_dependencies.rb +0 -7
- data/db/migrate/201311192003_reassociate_manual_approval.rb +0 -13
- data/db/migrate/201311192010_drop_approvals.rb +0 -5
- data/db/migrate/201401302113_re_reassociate_license.rb +0 -23
- data/db/migrate/201403181732_rename_manual_fields.rb +0 -10
- data/db/migrate/201403190028_add_manual_approvals.rb +0 -22
- data/db/migrate/201403191419_add_timestamps_to_manual_approvals.rb +0 -15
- data/db/migrate/201403191645_remove_license_aliases.rb +0 -23
- data/db/migrate/201410031451_rename_dependency_license_name.rb +0 -6
- data/features/cli.feature +0 -37
- data/features/cocoapods_dependencies.feature +0 -10
- data/features/configure_bundler_groups.feature +0 -23
- data/features/configure_ignore_dependencies.feature +0 -16
- data/features/configure_project_name.feature +0 -10
- data/features/configure_whitelist.feature +0 -27
- data/features/gradle_dependencies.feature +0 -9
- data/features/manually_added.feature +0 -19
- data/features/manually_approved.feature +0 -10
- data/features/manually_assigned_license.feature +0 -16
- data/features/maven_dependencies.feature +0 -9
- data/features/multiple_licenses.feature +0 -9
- data/features/node_dependencies.feature +0 -9
- data/features/python_dependencies.feature +0 -9
- data/features/report_csv.feature +0 -15
- data/features/report_html.feature +0 -24
- data/features/step_definitions/cli_steps.rb +0 -51
- data/features/step_definitions/cocoapod_steps.rb +0 -8
- data/features/step_definitions/configure_bundler_groups_steps.rb +0 -30
- data/features/step_definitions/configure_ignore_dependencies.rb +0 -35
- data/features/step_definitions/configure_project_name_steps.rb +0 -3
- data/features/step_definitions/configure_whitelist_steps.rb +0 -45
- data/features/step_definitions/gradle_steps.rb +0 -8
- data/features/step_definitions/manually_added_steps.rb +0 -28
- data/features/step_definitions/manually_approved_steps.rb +0 -24
- data/features/step_definitions/manually_assigned_license_steps.rb +0 -34
- data/features/step_definitions/maven_steps.rb +0 -8
- data/features/step_definitions/multiple_licenses_steps.rb +0 -14
- data/features/step_definitions/node_steps.rb +0 -8
- data/features/step_definitions/python_steps.rb +0 -8
- data/features/step_definitions/report_csv_steps.rb +0 -20
- data/features/step_definitions/report_html_steps.rb +0 -60
- data/features/step_definitions/shared_steps.rb +0 -307
- data/lib/data/license_finder.example.yml +0 -12
- data/lib/license_finder/dependency_manager.rb +0 -92
- data/lib/license_finder/package_saver.rb +0 -44
- data/lib/license_finder/reports/dependency_report.rb +0 -34
- data/lib/license_finder/reports/detailed_text_report.rb +0 -19
- data/lib/license_finder/reports/formatted_report.rb +0 -40
- data/lib/license_finder/reports/reporter.rb +0 -27
- data/lib/license_finder/tables.rb +0 -9
- data/lib/license_finder/tables/bundler_group.rb +0 -7
- data/lib/license_finder/tables/dependency.rb +0 -113
- data/lib/license_finder/tables/manual_approval.rb +0 -13
- data/lib/license_finder/yml_to_sql.rb +0 -117
- data/lib/templates/html_report.erb +0 -117
- data/lib/templates/text_report.erb +0 -3
- data/release/gem_version.rb +0 -3
- data/release/manual_instructions.md +0 -29
- data/release/publish.sh +0 -32
- data/spec/fixtures/APACHE-2-LICENSE +0 -202
- data/spec/fixtures/GPLv2 +0 -339
- data/spec/fixtures/ISC-LICENSE +0 -10
- data/spec/fixtures/MIT-LICENSE +0 -22
- data/spec/fixtures/MIT-LICENSE-with-varied-disclaimer +0 -22
- data/spec/fixtures/README-with-MIT-LICENSE +0 -222
- data/spec/fixtures/license_directory/LICENSE/BSD-2-Clause.txt +0 -25
- data/spec/fixtures/license_directory/LICENSE/GPL-2.0.txt +0 -339
- data/spec/fixtures/license_directory/LICENSE/LICENSE +0 -191
- data/spec/fixtures/license_directory/LICENSE/MIT.txt +0 -21
- data/spec/fixtures/license_directory/LICENSE/RUBY.txt +0 -60
- data/spec/fixtures/mit_licensed_gem/LICENSE +0 -22
- data/spec/fixtures/other_licensed_gem/LICENSE +0 -3
- data/spec/fixtures/readme/Project ReadMe b/data/spec/fixtures/readme/Project → ReadMe +0 -0
- data/spec/fixtures/readme/README +0 -0
- data/spec/fixtures/readme/Readme.markdown +0 -0
- data/spec/lib/license_finder/cli_spec.rb +0 -298
- data/spec/lib/license_finder/dependency_manager_spec.rb +0 -198
- data/spec/lib/license_finder/package_saver_spec.rb +0 -82
- data/spec/lib/license_finder/reports/detailed_text_report_spec.rb +0 -33
- data/spec/lib/license_finder/reports/reporter_spec.rb +0 -33
- data/spec/lib/license_finder/tables/dependency_spec.rb +0 -196
- data/spec/lib/license_finder/yml_to_sql_spec.rb +0 -123
- data/spec/lib/license_finder_spec.rb +0 -16
data/Rakefile
CHANGED
@@ -3,31 +3,35 @@ Bundler::GemHelper.install_tasks
|
|
3
3
|
|
4
4
|
require './lib/license_finder/platform'
|
5
5
|
require 'rspec/core/rake_task'
|
6
|
-
require 'cucumber'
|
7
|
-
require 'cucumber/rake/task'
|
8
6
|
|
9
7
|
desc "Run all specs in spec/"
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
task :spec do
|
9
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
10
|
+
t.fail_on_error = true
|
11
|
+
t.pattern = "./spec/**/*_spec.rb"
|
12
|
+
t.rspec_opts = %w[--color]
|
13
|
+
end
|
14
14
|
end
|
15
15
|
|
16
|
-
desc "Run all
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
desc "Run all specs in features/"
|
17
|
+
task :features do
|
18
|
+
RSpec::Core::RakeTask.new(:features) do |t|
|
19
|
+
t.fail_on_error = true
|
20
|
+
t.pattern = "./features/**/*_spec.rb"
|
21
|
+
opts = %w[--color --format d]
|
22
|
+
opts += LicenseFinder::Platform.darwin? ? [] : %w[--tag ~ios]
|
23
|
+
t.rspec_opts = opts
|
24
|
+
end
|
20
25
|
end
|
21
26
|
|
22
27
|
desc "Check for non-Ruby development dependencies."
|
23
28
|
task :check_dependencies do
|
24
|
-
require "open3"
|
25
|
-
|
26
29
|
dependencies = {
|
27
30
|
"mvn" => "Maven",
|
28
31
|
"npm" => "node.js",
|
29
32
|
"pip" => "Python",
|
30
|
-
"gradle" => "Gradle"
|
33
|
+
"gradle" => "Gradle",
|
34
|
+
"bower" => "Bower"
|
31
35
|
}
|
32
36
|
dependencies["pod"] = "Cocoapods" if LicenseFinder::Platform.darwin?
|
33
37
|
satisfied = true
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "License Finder command line executable" do
|
4
|
+
# As a developer
|
5
|
+
# I want a command-line interface
|
6
|
+
# So that I can manage my application's dependencies and licenses
|
7
|
+
|
8
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
9
|
+
|
10
|
+
specify "reports unapproved dependencies" do
|
11
|
+
user.create_empty_project
|
12
|
+
user.execute_command("license_finder dependencies add unapproved_gem Whatever")
|
13
|
+
|
14
|
+
user.run_license_finder
|
15
|
+
expect(user).to be_receiving_exit_code(1)
|
16
|
+
expect(user).to be_seeing 'unapproved_gem'
|
17
|
+
end
|
18
|
+
|
19
|
+
specify "reports that all dependencies are approved" do
|
20
|
+
user.create_empty_project
|
21
|
+
|
22
|
+
user.run_license_finder
|
23
|
+
expect(user).to be_receiving_exit_code(0)
|
24
|
+
expect(user).to be_seeing 'All dependencies are approved for use'
|
25
|
+
end
|
26
|
+
|
27
|
+
specify "shows usage and subcommand help" do
|
28
|
+
user.create_empty_project
|
29
|
+
|
30
|
+
user.execute_command "license_finder help"
|
31
|
+
expect(user).to be_seeing 'license_finder help [COMMAND]'
|
32
|
+
|
33
|
+
user.execute_command "license_finder ignored_groups help add"
|
34
|
+
expect(user).to be_seeing 'license_finder ignored_groups add GROUP'
|
35
|
+
end
|
36
|
+
|
37
|
+
it "reports `license_finder`'s license is MIT" do
|
38
|
+
user.create_ruby_app # has license_finder as a dependency
|
39
|
+
|
40
|
+
user.run_license_finder
|
41
|
+
expect(user).to be_seeing_something_like /license_finder.*MIT/
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Manually Added Dependencies" do
|
4
|
+
# As a developer
|
5
|
+
# I want to be able to manually add dependencies
|
6
|
+
# So that I can track dependencies not managed by Bundler, NPM, etc.
|
7
|
+
|
8
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
9
|
+
|
10
|
+
before { user.create_empty_project }
|
11
|
+
|
12
|
+
specify "appear in reports" do
|
13
|
+
user.execute_command 'license_finder dependencies add manual_dep MIT 1.2.3'
|
14
|
+
|
15
|
+
user.run_license_finder
|
16
|
+
expect(user).to be_seeing 'manual_dep, 1.2.3, MIT'
|
17
|
+
end
|
18
|
+
|
19
|
+
specify "can be simultaneously approved" do
|
20
|
+
user.execute_command 'license_finder dependencies add --approve manual Whatever'
|
21
|
+
|
22
|
+
user.run_license_finder
|
23
|
+
expect(user).not_to be_seeing 'manual_dep'
|
24
|
+
end
|
25
|
+
|
26
|
+
specify "appear in the CLI" do
|
27
|
+
user.execute_command 'license_finder dependencies add manual_dep Whatever'
|
28
|
+
expect(user).to be_seeing 'manual_dep'
|
29
|
+
|
30
|
+
user.execute_command 'license_finder dependencies list'
|
31
|
+
expect(user).to be_seeing 'manual_dep'
|
32
|
+
|
33
|
+
user.execute_command 'license_finder dependencies remove manual_dep'
|
34
|
+
user.execute_command 'license_finder dependencies list'
|
35
|
+
expect(user).to_not be_seeing 'manual_dep'
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Manually Approved Dependencies" do
|
4
|
+
# As a developer
|
5
|
+
# I want to approve dependencies that do not have whitelisted licenses
|
6
|
+
# So that I can track the dependencies which my business has approved
|
7
|
+
|
8
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
9
|
+
|
10
|
+
before do
|
11
|
+
user.create_empty_project
|
12
|
+
user.execute_command 'license_finder dependencies add manual_dep MIT 1.2.3'
|
13
|
+
user.execute_command "license_finder approval add manual_dep --who 'Julian' --why 'We really need this'"
|
14
|
+
end
|
15
|
+
|
16
|
+
specify "do not appear in action items" do
|
17
|
+
user.run_license_finder
|
18
|
+
expect(user).to_not be_seeing "manual_dep"
|
19
|
+
end
|
20
|
+
|
21
|
+
specify "include approval detail in reports" do
|
22
|
+
html = user.view_html
|
23
|
+
expect(html).to be_approved 'manual_dep'
|
24
|
+
|
25
|
+
html.in_dep("manual_dep") do |section|
|
26
|
+
expect(section).to have_content "Julian"
|
27
|
+
expect(section).to have_content "We really need this"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Manually Assigned Licenses" do
|
4
|
+
# As a developer
|
5
|
+
# I want to be able to override the licenses license_finder finds
|
6
|
+
# So that my dependencies all have the correct licenses
|
7
|
+
|
8
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
9
|
+
|
10
|
+
specify "are shown in reports" do
|
11
|
+
project = user.create_ruby_app
|
12
|
+
gem = user.create_gem 'mislicensed_dep', license: 'Unknown'
|
13
|
+
project.depend_on gem
|
14
|
+
user.execute_command 'license_finder licenses add mislicensed_dep Known'
|
15
|
+
|
16
|
+
user.run_license_finder
|
17
|
+
expect(user).not_to be_seeing_something_like /mislicensed_dep.*Unknown/
|
18
|
+
expect(user).to be_seeing_something_like /mislicensed_dep.*Known/
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Ignored Dependencies" do
|
4
|
+
# As a developer
|
5
|
+
# I want to ignore certain dependencies
|
6
|
+
# To avoid frequently changing reports about dependencies I know will always be approved
|
7
|
+
|
8
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
9
|
+
|
10
|
+
before do
|
11
|
+
user.create_empty_project
|
12
|
+
user.execute_command 'license_finder dependencies add ignored_dep Whatever'
|
13
|
+
end
|
14
|
+
|
15
|
+
specify "are excluded from reports" do
|
16
|
+
user.execute_command 'license_finder ignored_dependencies add ignored_dep'
|
17
|
+
|
18
|
+
user.run_license_finder
|
19
|
+
expect(user).to_not be_seeing 'ignored_dep'
|
20
|
+
user.execute_command('license_finder report')
|
21
|
+
expect(user).to_not be_seeing 'ignored_dep'
|
22
|
+
end
|
23
|
+
|
24
|
+
specify "appear in the CLI" do
|
25
|
+
user.execute_command 'license_finder ignored_dependencies add ignored_dep'
|
26
|
+
expect(user).to be_seeing 'ignored_dep'
|
27
|
+
|
28
|
+
user.execute_command 'license_finder ignored_dependencies list'
|
29
|
+
expect(user).to be_seeing 'ignored_dep'
|
30
|
+
|
31
|
+
user.execute_command 'license_finder ignored_dependencies remove ignored_dep'
|
32
|
+
user.execute_command 'license_finder ignored_dependencies list'
|
33
|
+
expect(user).to_not be_seeing 'ignored_dep'
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Ignored Groups" do
|
4
|
+
# As a developer
|
5
|
+
# I want to ignore certain groups
|
6
|
+
# So that any gems I use in development, or for testing, are automatically approved for use
|
7
|
+
|
8
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
9
|
+
|
10
|
+
specify "are excluded from reports" do
|
11
|
+
project = user.create_ruby_app
|
12
|
+
gem = user.create_gem 'dev_gem', license: 'GPL'
|
13
|
+
project.depend_on gem, groups: ['dev']
|
14
|
+
user.execute_command 'license_finder ignored_group add dev'
|
15
|
+
|
16
|
+
user.run_license_finder
|
17
|
+
expect(user).to_not be_seeing 'dev_gem'
|
18
|
+
end
|
19
|
+
|
20
|
+
specify "appear in the CLI" do
|
21
|
+
user.create_empty_project
|
22
|
+
user.execute_command 'license_finder ignored_group add dev'
|
23
|
+
expect(user).to be_seeing 'dev'
|
24
|
+
user.execute_command 'license_finder ignored_group list'
|
25
|
+
expect(user).to be_seeing 'dev'
|
26
|
+
|
27
|
+
user.execute_command 'license_finder ignored_group remove dev'
|
28
|
+
user.execute_command 'license_finder ignored_group list'
|
29
|
+
expect(user).to_not be_seeing 'dev'
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Project name" do
|
4
|
+
# As a developer
|
5
|
+
# I want to assign a name for my project
|
6
|
+
# So that the reports show it
|
7
|
+
|
8
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
9
|
+
|
10
|
+
before { user.create_empty_project }
|
11
|
+
|
12
|
+
specify "appears in the HTML report" do
|
13
|
+
user.execute_command 'license_finder project_name add changed_name'
|
14
|
+
|
15
|
+
expect(user.view_html).to be_titled 'changed_name'
|
16
|
+
end
|
17
|
+
|
18
|
+
specify "defaults to the directory name" do
|
19
|
+
expect(user.view_html).to be_titled 'my_app'
|
20
|
+
end
|
21
|
+
|
22
|
+
specify "appears in the CLI" do
|
23
|
+
user.execute_command 'license_finder project_name add my_proj'
|
24
|
+
expect(user).to be_seeing 'my_proj'
|
25
|
+
user.execute_command 'license_finder project_name show'
|
26
|
+
expect(user).to be_seeing 'my_proj'
|
27
|
+
|
28
|
+
user.execute_command 'license_finder project_name remove'
|
29
|
+
user.execute_command 'license_finder project_name show'
|
30
|
+
expect(user).to_not be_seeing 'my_proj'
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Whitelisted licenses" do
|
4
|
+
# As a developer
|
5
|
+
# I want to whitelist certain OSS licenses that my business has pre-approved
|
6
|
+
# So that any dependencies with those licenses do not show up as action items
|
7
|
+
|
8
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
9
|
+
|
10
|
+
before { user.create_empty_project }
|
11
|
+
|
12
|
+
specify "approve dependencies with those licenses" do
|
13
|
+
user.execute_command 'license_finder dependencies add bsd_gem BSD'
|
14
|
+
user.execute_command 'license_finder whitelist add BSD'
|
15
|
+
|
16
|
+
user.run_license_finder
|
17
|
+
expect(user).to_not be_seeing 'bsd_gem'
|
18
|
+
end
|
19
|
+
|
20
|
+
specify "approve dependencies with any of those licenses" do
|
21
|
+
user.execute_command 'license_finder dependencies add dep_with_many_licenses GPL'
|
22
|
+
user.execute_command 'license_finder licenses add dep_with_many_licenses MIT'
|
23
|
+
user.execute_command 'license_finder whitelist add GPL'
|
24
|
+
|
25
|
+
user.run_license_finder
|
26
|
+
expect(user).not_to be_seeing 'dep_with_many_licenses'
|
27
|
+
end
|
28
|
+
|
29
|
+
specify "are shown in the CLI" do
|
30
|
+
user.execute_command 'license_finder whitelist add Expat'
|
31
|
+
expect(user).to be_seeing 'Expat'
|
32
|
+
user.execute_command 'license_finder whitelist list'
|
33
|
+
expect(user).to be_seeing 'MIT'
|
34
|
+
|
35
|
+
user.execute_command 'license_finder whitelist remove Expat'
|
36
|
+
expect(user).to be_seeing 'Expat'
|
37
|
+
user.execute_command 'license_finder whitelist list'
|
38
|
+
expect(user).to_not be_seeing 'MIT'
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Bower Dependencies" do
|
4
|
+
# As a JS developer
|
5
|
+
# I want to be able to manage Bower dependencies
|
6
|
+
|
7
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
8
|
+
|
9
|
+
specify "are shown in reports" do
|
10
|
+
LicenseFinder::TestingDSL::BowerProject.create
|
11
|
+
user.run_license_finder
|
12
|
+
expect(user).to be_seeing_line "gmaps, 0.2.30, MIT"
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "CocoaPods Dependencies", ios: true do
|
4
|
+
# As a Mac developer
|
5
|
+
# I want to be able to manage CocoaPods dependencies
|
6
|
+
|
7
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
8
|
+
|
9
|
+
specify "are shown in reports" do
|
10
|
+
LicenseFinder::TestingDSL::CocoaPodsProject.create
|
11
|
+
user.run_license_finder
|
12
|
+
expect(user).to be_seeing_line "ABTest, 0.0.5, MIT"
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Gradle Dependencies" do
|
4
|
+
# As a Java developer
|
5
|
+
# I want to be able to manage Gradle dependencies
|
6
|
+
|
7
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
8
|
+
|
9
|
+
specify "are shown in reports" do
|
10
|
+
LicenseFinder::TestingDSL::GradleProject.create
|
11
|
+
user.run_license_finder
|
12
|
+
expect(user).to be_seeing_line 'junit, 4.11, "Common Public License Version 1.0"'
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Maven Dependencies" do
|
4
|
+
# As a Java developer
|
5
|
+
# I want to be able to manage Maven dependencies
|
6
|
+
|
7
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
8
|
+
|
9
|
+
specify "are shown in reports" do
|
10
|
+
LicenseFinder::TestingDSL::MavenProject.create
|
11
|
+
user.run_license_finder
|
12
|
+
expect(user).to be_seeing_line 'junit, 4.11, "Common Public License Version 1.0"'
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "NPM Dependencies" do
|
4
|
+
# As a Node developer
|
5
|
+
# I want to be able to manage NPM dependencies
|
6
|
+
|
7
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
8
|
+
|
9
|
+
specify "are shown in reports" do
|
10
|
+
LicenseFinder::TestingDSL::NpmProject.create
|
11
|
+
user.run_license_finder
|
12
|
+
expect(user).to be_seeing_line "http-server, 0.6.1, MIT"
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "Pip Dependencies" do
|
4
|
+
# As a Python developer
|
5
|
+
# I want to be able to manage Pip dependencies
|
6
|
+
|
7
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
8
|
+
|
9
|
+
specify "are shown in reports" do
|
10
|
+
LicenseFinder::TestingDSL::PipProject.create
|
11
|
+
user.run_license_finder
|
12
|
+
expect(user).to be_seeing_line 'argparse, 1.2.1, "Python Software Foundation License"'
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'feature_helper'
|
2
|
+
|
3
|
+
describe "CSV report" do
|
4
|
+
# As a non-technical application product owner
|
5
|
+
# I want license finder to generate an easy-to-understand text report
|
6
|
+
# So that I can quickly review my application dependencies and licenses
|
7
|
+
|
8
|
+
let(:user) { LicenseFinder::TestingDSL::User.new }
|
9
|
+
|
10
|
+
specify "shows dependency data in CSV form" do
|
11
|
+
user.create_empty_project
|
12
|
+
user.execute_command 'license_finder dependencies add info_gem BSD 1.1.1'
|
13
|
+
|
14
|
+
user.execute_command('license_finder report --format csv --columns approved name version licenses')
|
15
|
+
expect(user).to be_seeing "Not approved,info_gem,1.1.1,BSD"
|
16
|
+
end
|
17
|
+
end
|