license_finder 1.0.0.0-java → 1.1.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.force-build +0 -0
  3. data/.travis.yml +8 -7
  4. data/CHANGELOG.rdoc +29 -1
  5. data/Rakefile +2 -2
  6. data/db/migrate/201311192003_reassociate_manual_approval.rb +2 -3
  7. data/db/migrate/201403181732_rename_manual_fields.rb +10 -0
  8. data/db/migrate/201403190028_add_manual_approvals.rb +22 -0
  9. data/db/migrate/201403191419_add_timestamps_to_manual_approvals.rb +15 -0
  10. data/db/migrate/201403191645_remove_license_aliases.rb +23 -0
  11. data/features/cli.feature +21 -20
  12. data/features/cocoapods_dependencies.feature +10 -0
  13. data/features/configure_bundler_groups.feature +23 -0
  14. data/features/configure_ignore_dependencies.feature +16 -0
  15. data/features/{project_name.feature → configure_project_name.feature} +1 -1
  16. data/features/{whitelist.feature → configure_whitelist.feature} +6 -6
  17. data/features/manually_added.feature +19 -0
  18. data/features/{approve_dependencies.feature → manually_approved.feature} +2 -2
  19. data/features/manually_assigned_license.feature +16 -0
  20. data/features/{text_report.feature → report_csv.feature} +2 -2
  21. data/features/{html_report.feature → report_html.feature} +2 -2
  22. data/features/step_definitions/cli_steps.rb +22 -32
  23. data/features/step_definitions/cocoapod_steps.rb +8 -0
  24. data/features/step_definitions/configure_bundler_groups_steps.rb +30 -0
  25. data/features/step_definitions/configure_ignore_dependencies.rb +35 -0
  26. data/features/step_definitions/{project_name_steps.rb → configure_project_name_steps.rb} +0 -0
  27. data/features/step_definitions/configure_whitelist_steps.rb +45 -0
  28. data/features/step_definitions/gradle_steps.rb +2 -2
  29. data/features/step_definitions/manually_added_steps.rb +28 -0
  30. data/features/step_definitions/manually_approved_steps.rb +24 -0
  31. data/features/step_definitions/manually_assigned_license_steps.rb +34 -0
  32. data/features/step_definitions/maven_steps.rb +2 -2
  33. data/features/step_definitions/node_steps.rb +2 -2
  34. data/features/step_definitions/python_steps.rb +1 -1
  35. data/features/step_definitions/report_csv_steps.rb +20 -0
  36. data/features/step_definitions/report_html_steps.rb +60 -0
  37. data/features/step_definitions/shared_steps.rb +125 -104
  38. data/{files/license_finder.yml → lib/data/license_finder.example.yml} +3 -0
  39. data/lib/license_finder.rb +3 -2
  40. data/lib/license_finder/cli.rb +94 -49
  41. data/lib/license_finder/configuration.rb +21 -14
  42. data/lib/license_finder/dependency_manager.rb +27 -19
  43. data/lib/license_finder/license.rb +33 -19
  44. data/lib/license_finder/license/definitions.rb +153 -104
  45. data/lib/license_finder/license/matcher.rb +6 -1
  46. data/lib/license_finder/license/none_matcher.rb +9 -0
  47. data/lib/license_finder/license/text.rb +1 -0
  48. data/lib/license_finder/package.rb +30 -6
  49. data/lib/license_finder/package_managers/bower.rb +2 -2
  50. data/lib/license_finder/package_managers/bower_package.rb +2 -2
  51. data/lib/license_finder/package_managers/bundler.rb +9 -17
  52. data/lib/license_finder/package_managers/bundler_package.rb +1 -1
  53. data/lib/license_finder/package_managers/cocoa_pods.rb +35 -0
  54. data/lib/license_finder/package_managers/cocoa_pods_package.rb +19 -0
  55. data/lib/license_finder/package_managers/gradle.rb +9 -5
  56. data/lib/license_finder/package_managers/gradle_package.rb +4 -4
  57. data/lib/license_finder/package_managers/maven.rb +7 -3
  58. data/lib/license_finder/package_managers/maven_package.rb +5 -5
  59. data/lib/license_finder/package_managers/npm.rb +2 -2
  60. data/lib/license_finder/package_managers/npm_package.rb +2 -2
  61. data/lib/license_finder/package_managers/pip.rb +2 -2
  62. data/lib/license_finder/package_managers/pip_package.rb +7 -11
  63. data/lib/license_finder/package_saver.rb +12 -10
  64. data/lib/license_finder/possible_license_file.rb +1 -1
  65. data/lib/license_finder/possible_license_files.rb +11 -15
  66. data/lib/license_finder/reports/formatted_report.rb +25 -6
  67. data/lib/license_finder/reports/html_report.rb +2 -1
  68. data/lib/license_finder/reports/reporter.rb +3 -3
  69. data/lib/license_finder/tables.rb +6 -4
  70. data/lib/license_finder/tables/dependency.rb +36 -16
  71. data/lib/license_finder/tables/manual_approval.rb +13 -0
  72. data/lib/license_finder/yml_to_sql.rb +12 -9
  73. data/lib/templates/html_report.erb +68 -74
  74. data/lib/templates/markdown_report.erb +20 -21
  75. data/license_finder.gemspec +7 -7
  76. data/readme.md +76 -79
  77. data/spec/fixtures/Podfile +3 -0
  78. data/spec/lib/license_finder/cli_spec.rb +71 -23
  79. data/spec/lib/license_finder/configuration_spec.rb +61 -21
  80. data/spec/lib/license_finder/dependency_manager_spec.rb +52 -33
  81. data/spec/lib/license_finder/license/definitions_spec.rb +30 -14
  82. data/spec/lib/license_finder/license_spec.rb +55 -12
  83. data/spec/lib/license_finder/package_managers/bower_package_spec.rb +38 -19
  84. data/spec/lib/license_finder/package_managers/bower_spec.rb +10 -16
  85. data/spec/lib/license_finder/package_managers/bundler_package_spec.rb +39 -15
  86. data/spec/lib/license_finder/package_managers/bundler_spec.rb +10 -22
  87. data/spec/lib/license_finder/package_managers/cocoa_pods_package_spec.rb +44 -0
  88. data/spec/lib/license_finder/package_managers/cocoa_pods_spec.rb +79 -0
  89. data/spec/lib/license_finder/package_managers/gradle_package_spec.rb +4 -5
  90. data/spec/lib/license_finder/package_managers/gradle_spec.rb +26 -20
  91. data/spec/lib/license_finder/package_managers/maven_package_spec.rb +4 -5
  92. data/spec/lib/license_finder/package_managers/maven_spec.rb +16 -19
  93. data/spec/lib/license_finder/package_managers/npm_package_spec.rb +39 -19
  94. data/spec/lib/license_finder/package_managers/npm_spec.rb +10 -16
  95. data/spec/lib/license_finder/package_managers/pip_package_spec.rb +8 -8
  96. data/spec/lib/license_finder/package_managers/pip_spec.rb +10 -16
  97. data/spec/lib/license_finder/package_saver_spec.rb +27 -3
  98. data/spec/lib/license_finder/possible_license_file_spec.rb +25 -23
  99. data/spec/lib/license_finder/reports/detailed_text_report_spec.rb +6 -8
  100. data/spec/lib/license_finder/reports/html_report_spec.rb +45 -44
  101. data/spec/lib/license_finder/reports/markdown_report_spec.rb +8 -9
  102. data/spec/lib/license_finder/reports/reporter_spec.rb +1 -1
  103. data/spec/lib/license_finder/reports/text_report_spec.rb +6 -8
  104. data/spec/lib/license_finder/tables/dependency_spec.rb +57 -41
  105. data/spec/lib/license_finder/yml_to_sql_spec.rb +94 -92
  106. data/spec/spec_helper.rb +1 -0
  107. data/spec/support/stdout_helpers.rb +25 -0
  108. metadata +86 -69
  109. data/MIT.LICENSE +0 -20
  110. data/features/ignore_bundle_groups.feature +0 -23
  111. data/features/manually_managed_dependencies.feature +0 -19
  112. data/features/set_license.feature +0 -10
  113. data/features/step_definitions/approve_dependencies_steps.rb +0 -25
  114. data/features/step_definitions/html_report_steps.rb +0 -62
  115. data/features/step_definitions/ignore_bundle_groups_steps.rb +0 -29
  116. data/features/step_definitions/manually_managed_steps.rb +0 -33
  117. data/features/step_definitions/set_license_steps.rb +0 -20
  118. data/features/step_definitions/text_report_steps.rb +0 -19
  119. data/features/step_definitions/whitelist_steps.rb +0 -45
  120. data/files/dependency_breakdown.png +0 -0
  121. data/files/report_breakdown.png +0 -0
  122. data/lib/license_finder/license_url.rb +0 -9
  123. data/lib/license_finder/tables/license_alias.rb +0 -22
  124. data/spec/lib/license_finder/license_url_spec.rb +0 -16
  125. data/spec/lib/license_finder/tables/license_alias_spec.rb +0 -37
  126. data/spec/support/silence_stdout.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bfbd9c59602704b7c3a40d8ecd9e31e52891a59
4
- data.tar.gz: 3f06d5b52cdb43ddf1d8e1f7e0181a6dc1812d37
3
+ metadata.gz: 5748734ffbeee366e0396f06f2560233e6c121b4
4
+ data.tar.gz: 6896b31ebe755429dea0111105ec7ade8c05072e
5
5
  SHA512:
6
- metadata.gz: ea159ba85c83ae2758bf0ccf26345f596c42f814d5b37e2e67d8fca3d51dd9bd72837bdc4d402092f8f47200c788deb9876166ac921ebad802a9aa78e53f6a6e
7
- data.tar.gz: bf0c2f24a983fc2318bacdf4c89dbbbbaff3ad3a656e7fe5fe419895e0d740743b1298903ce423d6bea16c2573d02feecc710b32ee8a1de8a32702c65fdffe60
6
+ metadata.gz: c63f791ef6170d0b928a8ff909d3a32850bcf5e3687862160dd92ea5a7f2e59b5e9e90c2ec3dd9c5baa56b7e8969fdda83fc3b4cdd93ecc09e19dbfa1e77e6ed
7
+ data.tar.gz: 90825a990cffb6b80bf4e4f4b61c3340fa27966580ccc6a33e91c8e72873d656d39b3dee0a9cd6d6caece82911f18febb6e7368b538873bc5b8eafff5753edd3
File without changes
@@ -3,7 +3,6 @@ rvm:
3
3
  - 2.0.0
4
4
  - 1.9.3
5
5
  - jruby-19mode
6
- - jruby-20mode
7
6
  - ruby-head
8
7
  - jruby-head
9
8
 
@@ -12,7 +11,8 @@ matrix:
12
11
  - rvm: ruby-head
13
12
  - rvm: jruby-head
14
13
 
15
- env: JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1' JRUBY_OPTS='-J-Djruby.launch.inproc=true'
14
+ env:
15
+ - JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1' JRUBY_OPTS='-J-Djruby.launch.inproc=true' PATH=$PATH:$HOME/gradle/bin
16
16
 
17
17
  notifications:
18
18
  email:
@@ -23,8 +23,9 @@ notifications:
23
23
  on_start: true
24
24
 
25
25
  before_install:
26
- - sudo apt-get update
27
-
28
- install:
29
- - sudo apt-get install gradle -qq -y
30
- - bundle install
26
+ - cd /tmp
27
+ - wget http://services.gradle.org/distributions/gradle-1.11-all.zip
28
+ - unzip gradle*
29
+ - rm gradle*.zip
30
+ - mv gradle* ~/gradle
31
+ - cd -
@@ -1,4 +1,32 @@
1
- === 1.0.0 / Unreleased
1
+ === 1.1.1 / 2014-07-29
2
+
3
+ * Bugfixes
4
+
5
+ * Process incorrectly-defined dependencies.
6
+ [Original issue.](https://github.com/pivotal/LicenseFinder/issues/108)
7
+ * Allow license_finder to process incorrectly-defined dependencies.
8
+
9
+ === 1.0.1 / 2014-05-28
10
+
11
+ * Features
12
+
13
+ * For dependencies with multiple licenses, the dependency is listed as
14
+ 'multiple licenses' along with the names of each license
15
+ * Added 'ignore_dependencies' config option to allow specific
16
+ dependencies to be excluded from reports.
17
+
18
+ * Bugfixes
19
+
20
+ * Dependency reports generate when license_finder.yml updates
21
+ * Dependency reports generate when config is changed through the command line
22
+
23
+ === 1.0.0.1 / 2014-05-23
24
+
25
+ * Bugfixes
26
+
27
+ * LicenseFinder detects its own license
28
+
29
+ === 1.0.0 / 2014-04-03
2
30
 
3
31
  * Features
4
32
 
data/Rakefile CHANGED
@@ -12,10 +12,10 @@ RSpec::Core::RakeTask.new(:spec) do |t|
12
12
  t.rspec_opts = %w[--color]
13
13
  end
14
14
 
15
-
16
15
  desc "Run all cukes in features/"
17
16
  Cucumber::Rake::Task.new(:features) do |t|
18
- t.cucumber_opts = "features --format pretty"
17
+ tags = RUBY_PLATFORM =~ /darwin/ ? "" : "--tags ~@ios"
18
+ t.cucumber_opts = "features --format pretty #{tags}"
19
19
  end
20
20
 
21
21
  task :default => [:spec, :features]
@@ -6,9 +6,8 @@ Sequel.migration do
6
6
  (SELECT state
7
7
  FROM
8
8
  approvals
9
- INNER JOIN
10
- dependencies
11
- ON approvals.id = dependencies.approval_id)
9
+ WHERE
10
+ approvals.id = dependencies.approval_id)
12
11
  EOS
13
12
  end
14
13
  end
@@ -0,0 +1,10 @@
1
+ Sequel.migration do
2
+ up do
3
+ alter_table(:dependencies) do
4
+ rename_column :manual, :added_manually
5
+ rename_column :manually_approved, :approved_manually
6
+ rename_column :license_manual, :license_assigned_manually
7
+ drop_column :approval_id
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,22 @@
1
+ Sequel.migration do
2
+ up do
3
+ create_table(:manual_approvals) do
4
+ primary_key :id
5
+ foreign_key :dependency_id, :dependencies, unique: true, on_delete: :cascade
6
+ String :approver, null: true
7
+ String :notes, null: true
8
+ end
9
+
10
+ LicenseFinder::DB << <<-SQL
11
+ INSERT INTO manual_approvals
12
+ (dependency_id)
13
+ SELECT id
14
+ FROM dependencies
15
+ WHERE approved_manually;
16
+ SQL
17
+
18
+ alter_table(:dependencies) do
19
+ drop_column :approved_manually
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,15 @@
1
+ Sequel.migration do
2
+ change do
3
+ alter_table(:manual_approvals) do
4
+ add_column :created_at, DateTime
5
+ add_column :updated_at, DateTime
6
+ end
7
+
8
+ LicenseFinder::DB << <<-SQL
9
+ UPDATE manual_approvals
10
+ SET
11
+ created_at = datetime('now'),
12
+ updated_at = datetime('now')
13
+ SQL
14
+ end
15
+ end
@@ -0,0 +1,23 @@
1
+ Sequel.migration do
2
+ up do
3
+ alter_table(:dependencies) do
4
+ add_column :license_name, String
5
+ end
6
+
7
+ LicenseFinder::DB << <<-SQL
8
+ UPDATE dependencies
9
+ SET license_name =
10
+ (SELECT name
11
+ FROM
12
+ license_aliases
13
+ WHERE
14
+ license_id = license_aliases.id)
15
+ SQL
16
+
17
+ alter_table(:dependencies) do
18
+ drop_column :license_id
19
+ end
20
+
21
+ drop_table(:license_aliases)
22
+ end
23
+ end
@@ -1,36 +1,37 @@
1
1
  Feature: License Finder command line executable
2
- So that I can report and manage my application's dependencies and licenses to my business
2
+ So that I can manage my application's dependencies and licenses
3
3
  As an application developer
4
4
  I want a command-line interface
5
5
 
6
- Scenario: Running without a configuration file
7
- Given I have an app with license finder that has no config directory
8
- When I run license_finder
9
- Then it creates a config directory with the license_finder config
10
-
11
- Scenario: Auditing an application with non-whitelisted licenses
12
- Given I have an app with license finder that depends on a MIT licensed gem
6
+ Scenario: Auditing an application with unapproved licenses
7
+ Given I have an app with an unapproved dependency
13
8
  When I run license_finder
14
9
  Then it should exit with status code 1
15
- And should list my MIT gem in the output
10
+ And should list my unapproved dependency in the output
16
11
 
17
- Scenario: Auditing an application with whitelisted licenses
18
- Given I have an app with license finder that depends on a MIT licensed gem
19
- When I whitelist MIT, New BSD, Apache 2.0, Ruby, and other licenses
12
+ Scenario: Auditing an application with approved licenses
13
+ Given I have an app with an unapproved dependency
14
+ When I whitelist everything I can think of
20
15
  Then it should exit with status code 0
21
16
  And I should see all dependencies approved for use
22
17
 
23
- Scenario: Keep manually set license dependencies
24
- Given I have a project that depends on mime-types with a manual license type
25
- When I run license_finder
26
- Then the mime-types license remains set with my manual license type
27
-
28
18
  Scenario: Viewing help for license_finder subcommand
29
- Given I have an app with license finder
19
+ Given I have an app
30
20
  When I run license_finder help on a specific command
31
21
  Then I should see the correct subcommand usage instructions
32
22
 
33
23
  Scenario: Viewing help for license_finder default
34
- Given I have an app with license finder
24
+ Given I have an app
35
25
  When I run license_finder help
36
- Then I should the correct default usage instructions
26
+ Then I should see the default usage instructions
27
+
28
+ Scenario: Running without a configuration file
29
+ Given I have an app that has no config directory
30
+ When I run license_finder
31
+ Then it creates a config directory with the license_finder config
32
+
33
+ Scenario: Viewing License Finder's own license
34
+ Given I have an app
35
+ When I run license_finder
36
+ Then I should see License Finder has the MIT license
37
+
@@ -0,0 +1,10 @@
1
+ @ios
2
+ Feature: Tracking CocoaPods Dependencies
3
+ So that I can track CocoaPods dependencies
4
+ As an application developer using license finder
5
+ I want to be able to manage CocoaPods dependencies
6
+
7
+ Scenario: See the dependencies from the Podfile
8
+ Given A Podfile with dependencies
9
+ When I run license_finder
10
+ Then I should see a CocoaPods dependency with a license
@@ -0,0 +1,23 @@
1
+ Feature: Ignore Bundle Groups
2
+ As a developer
3
+ I want to ignore certain bundler groups
4
+ So that any gems I use in development, or for testing, are automatically approved for use
5
+
6
+ Scenario: Bundler groups can be ignored
7
+ Given I have an app
8
+ And I ignore the test group
9
+ When I get the ignored groups
10
+ Then I should see the test group in the output
11
+
12
+ Scenario: Ignored bundler groups are not evaluated for licenses
13
+ Given I have an app that depends on a gem in the test bundler group
14
+ And I ignore the test group
15
+ When I run license_finder
16
+ Then I should not see the test gem in the output
17
+
18
+ Scenario: Bundler groups can be removed from the ignore list
19
+ Given I have an app
20
+ And I ignore the test group
21
+ And I stop ignoring the test group
22
+ When I get the ignored groups
23
+ Then I should not see the test group in the output
@@ -0,0 +1,16 @@
1
+ Feature: Ignore Dependencies
2
+ As a developer
3
+ I want to ignore certain dependencies
4
+ To avoid noisy doc changes when there are safe dependencies with high version churn
5
+
6
+ Scenario: Select dependencies can be ignored
7
+ Given I have an app that depends on bundler
8
+ And I ignore the bundler dependency
9
+ When I get the ignored dependencies
10
+ Then I should see 'bundler' in the output
11
+ And I should not see 'bundler' in the dependency docs
12
+
13
+ Scenario: Ignored dependencies do not appear in the unapproved list
14
+ Given I have an app that depends on bundler
15
+ When I ignore the bundler dependency
16
+ Then the bundler dependency is not listed as an action item
@@ -4,7 +4,7 @@ Feature: Project names
4
4
  So that license audit reports indicate their associated project
5
5
 
6
6
  Scenario: Specifying a project name
7
- Given I have an app with license finder
7
+ Given I have an app
8
8
  When I set the project name to new_project
9
9
  And I run license_finder
10
10
  Then I should see the project name new_project in the html
@@ -4,24 +4,24 @@ Feature: Whitelist licenses
4
4
  So that any dependencies with those licenses do not show up as action items
5
5
 
6
6
  Scenario: Adding a license to the whitelist
7
- Given I have an app with license finder
7
+ Given I have an app
8
8
  When I whitelist the Expat license
9
9
  And I view the whitelisted licenses
10
10
  Then I should see Expat in the output
11
11
 
12
- Scenario: Whitelisting the BSD License should approve BSD licensed dependencies
13
- Given I have an app with license finder that depends on an BSD license
12
+ Scenario: Depending on whitelisted licenses
13
+ Given I have an app that depends on an BSD license
14
14
  When I whitelist the BSD license
15
15
  Then I should not see a BSD licensed gem unapproved
16
16
 
17
17
  Scenario: Removing a license from the whitelist
18
- Given I have an app with license finder
18
+ Given I have an app
19
19
  When I whitelist the Expat license
20
20
  And I remove Expat from the whitelist
21
21
  And I view the whitelisted licenses
22
22
  Then I should not see Expat in the output
23
23
 
24
- Scenario: Whitelist with MIT License aliased name "Expat" should whitelist "MIT" licenses
25
- Given I have an app with license finder that depends on an MIT license
24
+ Scenario: Whitelisting license aliases
25
+ Given I have an app that depends on an MIT license
26
26
  When I whitelist the Expat license
27
27
  Then I should not see a MIT licensed gem unapproved
@@ -0,0 +1,19 @@
1
+ Feature: Manually Adding Dependencies
2
+ So that I can track dependencies not managed by Bundler, NPM, etc.
3
+ As an application developer using license finder
4
+ I want to be able to manually add dependencies
5
+
6
+ Scenario: Manually adding dependency
7
+ Given I have an app
8
+ When I add my JS dependency
9
+ Then I should see the JS dependency in the console output
10
+
11
+ Scenario: Auto approving a manually added dependency
12
+ Given I have an app
13
+ When I add my JS dependency with an approval flag
14
+ Then I should not see the JS dependency in the console output
15
+
16
+ Scenario: Removing a manually added dependency
17
+ Given I have an app and a JS dependency
18
+ When I remove my JS dependency
19
+ Then I should not see the JS dependency in the console output
@@ -3,8 +3,8 @@ Feature: Approving non-whitelisted Dependencies
3
3
  As an application developer using license finder
4
4
  I want to be able to manually approve dependencies that have licenses which fall outside of my whitelist
5
5
 
6
- Scenario: Approving a non-whitelisted dependency via the `license_finder` command
7
- Given I have an app with license finder that depends on a GPL licensed gem
6
+ Scenario: Approving a non-whitelisted dependency
7
+ Given I have an app that depends on a GPL licensed gem
8
8
  When I approve that gem
9
9
  Then I should not see that gem in the console output
10
10
  And I should see that gem approved in dependencies.html
@@ -0,0 +1,16 @@
1
+ Feature: Setting a dependency's license
2
+ So that my dependencies all have the correct licenses
3
+ As an application developer
4
+ I want to be able to manually set licenses
5
+
6
+ Scenario: Setting a license for a dependency
7
+ Given I have an app that depends on a few gems without known licenses
8
+ When I set one gem's license to MIT from the command line
9
+ Then I should see that gem's license set to MIT
10
+ And I should see other gems have not changed their licenses
11
+
12
+ Scenario: Keep manually assigned license dependencies
13
+ Given I have an app that depends on a manually licensed gem
14
+ When I run license_finder
15
+ Then the gem should keep its manually assigned license
16
+
@@ -4,12 +4,12 @@ Feature: Text Report
4
4
  I want license finder to generate an easy-to-understand text report
5
5
 
6
6
  Scenario: Viewing dependencies
7
- Given I have an app with license finder that depends on a gem with license and version details
7
+ Given I have an app that depends on a gem with license and version details
8
8
  When I run license_finder
9
9
  Then I should see those version and license details in the dependencies.csv file
10
10
 
11
11
  Scenario: Cleaning up old versions of text report
12
- Given I have an app with license finder
12
+ Given I have an app
13
13
  And I have a dependencies.txt file
14
14
  When I run license_finder
15
15
  Then I should see dependencies.txt replaced by dependencies.csv
@@ -4,7 +4,7 @@ Feature: HTML Report
4
4
  I want license finder to generate an easy-to-understand HTML report
5
5
 
6
6
  Background:
7
- Given I have an app with license finder
7
+ Given I have an app
8
8
 
9
9
  Scenario: Dependency details listed in HTML report
10
10
  And my app depends on a gem with specific details
@@ -20,5 +20,5 @@ Feature: HTML Report
20
20
 
21
21
  Scenario: Dependency summary
22
22
  And my app depends on MIT and GPL licensed gems
23
- When I whitelist MIT, New BSD, Apache 2.0, Ruby, and other licenses
23
+ When I whitelist everything I can think of
24
24
  Then I should see only see GPL liceneses as unapproved in the html
@@ -1,61 +1,51 @@
1
- Given(/^I have an app with license finder that has no config directory$/) do
1
+ Given(/^I have an app that has no config directory$/) do
2
2
  @user = ::DSL::User.new
3
- @user.create_nonrails_app
4
- path = @user.app_path('config')
5
- FileUtils.rm_rf(path)
6
- File.should_not be_exists(path)
3
+ @user.create_ruby_app
4
+ path = @user.config_path
5
+ path.rmtree if path.exist?
6
+ path.should_not be_exist
7
7
  end
8
8
 
9
- Given(/^I have an app with license finder that depends on a MIT licensed gem$/) do
9
+ Given(/^I have an app with an unapproved dependency$/) do
10
10
  @user = ::DSL::User.new
11
- @user.create_nonrails_app
12
- @user.add_dependency_to_app 'mit_gem', :license => 'MIT'
13
- end
14
-
15
- Given(/^I have a project that depends on mime\-types with a manual license type$/) do
16
- @user = ::DSL::User.new
17
- @user.create_rails_app
18
- @user.add_gem_dependency('mime-types')
19
- @user.bundle_app
20
- @user.execute_command "license_finder --quiet"
21
- @output = @user.execute_command "license_finder license Ruby mime-types"
22
- @output.should =~ /mime-types.*Ruby/
11
+ @user.create_ruby_app
12
+ @user.create_and_depend_on_gem 'unapproved_gem', license: 'MIT'
23
13
  end
24
14
 
25
15
  When(/^I run license_finder help on a specific command$/) do
26
- @output = @user.execute_command "license_finder ignored_bundler_groups help add"
16
+ @user.execute_command "license_finder ignored_bundler_groups help add"
27
17
  end
28
18
 
29
19
  When(/^I run license_finder help$/) do
30
- @output = @user.execute_command "license_finder help"
20
+ @user.execute_command "license_finder help"
31
21
  end
32
22
 
33
23
  Then(/^it creates a config directory with the license_finder config$/) do
34
- File.should be_exists(@user.app_path('config'))
35
- text = "---\nwhitelist:\n#- MIT\n#- Apache 2.0\nignore_groups:\n#- test\n#- development\ndependencies_file_dir: './doc/'\nproject_name: # project name\n"
36
- File.read(@user.app_path('config/license_finder.yml')).should == text.gsub(/^\s+/, "")
24
+ @user.config_path.should be_exist
25
+ text = %|---\nwhitelist:\n#- MIT\n#- Apache 2.0\nignore_groups:\n#- test\n#- development\nignore_dependencies:\n#- bundler\ndependencies_file_dir: './doc/'\nproject_name: # project name\ngradle_command: # only meaningful if used with a Java/gradle project. Defaults to "gradle".\n|
26
+ @user.config_file.read.should == text.gsub(/^\s+/, "")
37
27
  end
38
28
 
39
29
  Then /^it should exit with status code (\d)$/ do |status|
40
30
  $?.exitstatus.should == status.to_i
41
31
  end
42
32
 
43
- Then(/^should list my MIT gem in the output$/) do
44
- @output.should include 'mit_gem'
33
+ Then(/^should list my unapproved dependency in the output$/) do
34
+ @user.should be_seeing 'unapproved_gem'
45
35
  end
46
36
 
47
37
  Then(/^I should see all dependencies approved for use$/) do
48
- @output.should include 'All dependencies are approved for use'
38
+ @user.should be_seeing 'All dependencies are approved for use'
49
39
  end
50
40
 
51
- Then(/^the mime\-types license remains set with my manual license type$/) do
52
- @output.should =~ /mime-types.*Ruby/
41
+ Then(/^I should see the correct subcommand usage instructions$/) do
42
+ @user.should be_seeing 'license_finder ignored_bundler_groups add GROUP'
53
43
  end
54
44
 
55
- Then(/^I should see the correct subcommand usage instructions$/) do
56
- @output.should include 'license_finder ignored_bundler_groups add GROUP'
45
+ Then(/^I should see the default usage instructions$/) do
46
+ @user.should be_seeing 'license_finder help [COMMAND]'
57
47
  end
58
48
 
59
- Then(/^I should the correct default usage instructions$/) do
60
- @output.should include 'license_finder help [COMMAND]'
49
+ Then(/^I should see License Finder has the MIT license$/) do
50
+ @user.should be_seeing_something_like /license_finder.*MIT/
61
51
  end