license_finder 2.0.0.rc2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -1
  3. data/CHANGELOG.rdoc +16 -9
  4. data/CONTRIBUTING.md +3 -3
  5. data/README.md +4 -1
  6. data/TODO.md +6 -19
  7. data/bin/license_finder_pip.py +2 -2
  8. data/features/features/cli_spec.rb +18 -18
  9. data/features/features/configure/add_dependencies_spec.rb +16 -16
  10. data/features/features/configure/approve_dependencies_spec.rb +10 -9
  11. data/features/features/configure/assign_licenses_spec.rb +8 -8
  12. data/features/features/configure/ignore_dependencies_spec.rb +15 -15
  13. data/features/features/configure/ignore_groups_spec.rb +15 -15
  14. data/features/features/configure/name_project_spec.rb +15 -14
  15. data/features/features/configure/whitelist_licenses_spec.rb +21 -21
  16. data/features/features/package_managers/bower_spec.rb +3 -3
  17. data/features/features/package_managers/cocoapods_spec.rb +4 -4
  18. data/features/features/package_managers/gradle_spec.rb +3 -3
  19. data/features/features/package_managers/maven_spec.rb +3 -3
  20. data/features/features/package_managers/npm_spec.rb +3 -3
  21. data/features/features/package_managers/pip_spec.rb +3 -3
  22. data/features/features/report/csv_spec.rb +9 -8
  23. data/features/features/report/html_spec.rb +13 -12
  24. data/features/support/testing_dsl.rb +1 -1
  25. data/lib/license_finder.rb +1 -16
  26. data/lib/license_finder/cli/approvals.rb +3 -4
  27. data/lib/license_finder/cli/base.rb +40 -3
  28. data/lib/license_finder/cli/dependencies.rb +3 -3
  29. data/lib/license_finder/cli/main.rb +7 -25
  30. data/lib/license_finder/cli/makes_decisions.rb +2 -20
  31. data/lib/license_finder/cli/patched_thor.rb +0 -2
  32. data/lib/license_finder/cli/whitelist.rb +6 -8
  33. data/lib/license_finder/configuration.rb +1 -1
  34. data/lib/license_finder/core.rb +68 -0
  35. data/lib/license_finder/decision_applier.rb +10 -7
  36. data/lib/license_finder/license.rb +10 -10
  37. data/lib/license_finder/license/template.rb +3 -2
  38. data/lib/license_finder/logger.rb +2 -6
  39. data/lib/license_finder/package.rb +25 -44
  40. data/lib/license_finder/package_manager.rb +11 -13
  41. data/lib/license_finder/package_managers/bower.rb +1 -1
  42. data/lib/license_finder/package_managers/bundler.rb +1 -1
  43. data/lib/license_finder/package_managers/cocoa_pods.rb +3 -3
  44. data/lib/license_finder/package_managers/cocoa_pods_package.rb +3 -3
  45. data/lib/license_finder/package_managers/gradle.rb +2 -2
  46. data/lib/license_finder/package_managers/maven.rb +2 -2
  47. data/lib/license_finder/package_managers/npm.rb +1 -1
  48. data/lib/license_finder/package_managers/pip.rb +1 -1
  49. data/lib/license_finder/package_managers/pip_package.rb +6 -4
  50. data/lib/license_finder/packages/activation.rb +54 -0
  51. data/lib/license_finder/{possible_license_files.rb → packages/license_files.rb} +9 -7
  52. data/lib/license_finder/packages/licensing.rb +43 -0
  53. data/lib/license_finder/{package_managers → packages}/manual_package.rb +0 -0
  54. data/lib/license_finder/{possible_license_file.rb → packages/possible_license_file.rb} +0 -2
  55. data/lib/license_finder/version.rb +1 -1
  56. data/spec/fixtures/{license_directory/LICENSE/Apache.txt → all_pms/Gemfile} +0 -0
  57. data/spec/fixtures/all_pms/Podfile +0 -0
  58. data/spec/fixtures/all_pms/bower.json +0 -0
  59. data/spec/fixtures/all_pms/build.gradle +0 -0
  60. data/spec/fixtures/all_pms/package.json +0 -0
  61. data/spec/fixtures/all_pms/pom.xml +0 -0
  62. data/spec/fixtures/all_pms/requirements.txt +0 -0
  63. data/spec/fixtures/license_directory/COPYING +1 -0
  64. data/spec/fixtures/license_directory/LICENSE/MIT.txt +1 -0
  65. data/spec/fixtures/license_names/COPYING.txt +1 -0
  66. data/spec/fixtures/license_names/LICENSE +1 -0
  67. data/spec/fixtures/license_names/Licence.rdoc +1 -0
  68. data/spec/fixtures/license_names/Mit-License +1 -0
  69. data/spec/fixtures/license_names/README.rdoc +1 -0
  70. data/spec/fixtures/nested_gem/vendor/LICENSE +1 -0
  71. data/spec/lib/license_finder/cli/approvals_spec.rb +9 -3
  72. data/spec/lib/license_finder/cli/dependencies_spec.rb +5 -2
  73. data/spec/lib/license_finder/cli/main_spec.rb +20 -27
  74. data/spec/lib/license_finder/configuration_spec.rb +1 -3
  75. data/spec/lib/license_finder/decision_applier_spec.rb +15 -15
  76. data/spec/lib/license_finder/decisions_spec.rb +94 -95
  77. data/spec/lib/license_finder/license_spec.rb +5 -5
  78. data/spec/lib/license_finder/package_managers/bower_package_spec.rb +0 -4
  79. data/spec/lib/license_finder/package_managers/bower_spec.rb +6 -27
  80. data/spec/lib/license_finder/package_managers/bundler_package_spec.rb +0 -2
  81. data/spec/lib/license_finder/package_managers/bundler_spec.rb +0 -15
  82. data/spec/lib/license_finder/package_managers/cocoa_pods_package_spec.rb +5 -2
  83. data/spec/lib/license_finder/package_managers/cocoa_pods_spec.rb +13 -31
  84. data/spec/lib/license_finder/package_managers/gradle_package_spec.rb +0 -2
  85. data/spec/lib/license_finder/package_managers/gradle_spec.rb +11 -35
  86. data/spec/lib/license_finder/package_managers/maven_package_spec.rb +0 -2
  87. data/spec/lib/license_finder/package_managers/maven_spec.rb +18 -56
  88. data/spec/lib/license_finder/package_managers/npm_package_spec.rb +0 -2
  89. data/spec/lib/license_finder/package_managers/npm_spec.rb +0 -17
  90. data/spec/lib/license_finder/package_managers/pip_package_spec.rb +0 -2
  91. data/spec/lib/license_finder/package_managers/pip_spec.rb +8 -25
  92. data/spec/lib/license_finder/package_spec.rb +2 -4
  93. data/spec/lib/license_finder/packages/activation_spec.rb +47 -0
  94. data/spec/lib/license_finder/{possible_license_files_spec.rb → packages/license_files_spec.rb} +2 -6
  95. data/spec/lib/license_finder/packages/licensing_spec.rb +1 -0
  96. data/spec/lib/license_finder/{possible_license_file_spec.rb → packages/possible_license_file_spec.rb} +0 -0
  97. data/spec/spec_helper.rb +2 -0
  98. data/spec/support/shared_examples_for_package_manager.rb +14 -1
  99. data/spec/support/test_fixtures.rb +7 -0
  100. metadata +117 -12
  101. data/spec/support/shared_examples_for_package.rb +0 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 272a63170ce7ba95ee485b5810c3d9bf525a0326
4
- data.tar.gz: f6e7364050de7afec4d9ffb95f3e1d20cadb780f
3
+ metadata.gz: cfcc32451073719f18ccbd51a98c62a8a741500f
4
+ data.tar.gz: 5d51cb13de5f31a9b994ec5259850432b7ad5b6d
5
5
  SHA512:
6
- metadata.gz: 3207fee7de7b192aac50c45208931002322a0dbc8fb24e30adb072a28dbacc6e11567c210895bd88163f65de2df0095db2ba7d39a75966b9ad636ae2d0b3c1d6
7
- data.tar.gz: 5dd187332ae0d7d61ebde94a3610c43b8a81ac60332bf963b3dab5518950f2ae7e6036c58d6570cd864d7bb038f2e3e96b70eb457686748eb31db33f0892e98a
6
+ metadata.gz: 1bf9e97e40975279f6e3a8b7920093be14084b7ac3cfb668e54ee1429b03e825a8d5120877959df8e626e82a5882a84c5f7109c599919fcf1af4cf159b1ea647
7
+ data.tar.gz: bea4e4ad49d7567e2650bac22d018f3361868a7d8eaf4e2d6f35d4c7958db902c9e18aa007221ad59395a058bcff3fdaf6410178fac96d696c3e7fe1c6e988e4
@@ -23,10 +23,12 @@ notifications:
23
23
  on_start: true
24
24
 
25
25
  before_install:
26
+ - python --version
27
+ - pip --version
26
28
  - cd /tmp
27
29
  - wget http://services.gradle.org/distributions/gradle-1.11-all.zip
28
30
  - unzip -q gradle*
29
31
  - rm gradle*.zip
30
32
  - mv gradle* ~/gradle
31
33
  - npm install -g bower
32
- - cd -
34
+ - cd -
@@ -1,19 +1,26 @@
1
- === 2.0.0 / unreleased
1
+ === 2.0.0 / 2015-03-02
2
2
 
3
3
  * Features
4
4
 
5
- * Stores (in an append-only YAML file) every decision that has been made
6
- about a project's dependencies, even if a decision was later reverted.
7
- * Stores timestamps and other metadata (who, why) about each decision.
5
+ * Stores every decision that has been made about a project's dependencies,
6
+ even if a decision was later reverted. These decisions are kept in an
7
+ append-only YAML file which can be considered an audit log.
8
+ * Stores timestamps and other optional transactional metadata (who, why)
9
+ about every kind of decision.
8
10
  * When needed, applies those decisions to the list of packages currently
9
11
  reported by the package managers.
12
+ * Removed dependencies on sqlite and sequel.
10
13
  * The CLI never writes HTML or CSV reports to the file system, only to
11
14
  STDOUT. So, users have more choice over which reports to generate, when to
12
- generate them, and where to put them. See `license_finder report`.
13
- * Removed dependencies on sqlite and sequel.
14
- * Minimized the responsibilities of the configuration YAML file. The CLI
15
- never updates the config file, which means less futzing with the file
16
- system. Makes room for replacing the config file with command line options.
15
+ generate them, and where to put them. See `license_finder report`. If you
16
+ would like to update reports automatically (e.g., in a rake task or git
17
+ hook) see this gist: https://gist.github.com/mainej/1a4d61a92234c5cebeab.
18
+ * The configuration YAML file is no longer required, though it can still be
19
+ useful. Most of its functionality has been moved into the decisions
20
+ infrastructure, and the remaining bits can be passed as arguments to the
21
+ CLI. Most users will not need these arguments. If the file is present, the
22
+ CLI arguments can be omitted. The CLI no longer updates this file.
23
+ * Requires pip >= 6.0
17
24
 
18
25
  * Bugfixes
19
26
 
@@ -11,9 +11,9 @@
11
11
 
12
12
  ## Development Dependencies
13
13
 
14
- To successfully run the test suite, you will need node.js, python, pip
15
- and gradle installed. If you run `rake check_dependencies`, you'll see
16
- exactly what you're missing.
14
+ To successfully run the test suite, you will need npm, maven, pip, gradle and
15
+ bower installed. If you run `rake check_dependencies`, you'll see exactly what
16
+ you're missing.
17
17
 
18
18
  ### Python
19
19
 
data/README.md CHANGED
@@ -306,8 +306,11 @@ downloadLicenses {
306
306
 
307
307
  ## Upgrading
308
308
 
309
- To upgrade from `license_finder` version ~1.2 to 2.0, see
309
+ To upgrade from `license_finder` version 1.2 to 2.0, see
310
310
  [`license_finder_upgrade`](https://github.com/mainej/license_finder_upgrade).
311
+ To upgrade to 2.0 from a version lower than 1.2, first upgrade to 1.2, and run
312
+ `license_finder` at least once. This will ensure that the `license_finder`
313
+ database is in a state which `license_finder_upgrade` understands.
311
314
 
312
315
 
313
316
  ## A Plea to Package Authors and Maintainers
data/TODO.md CHANGED
@@ -1,28 +1,15 @@
1
-
2
1
  # immediate
3
-
4
- - gradle and maven are broken
5
- - [x] let's refactor `PossibleLicenseFiles` to accept a nil install_path
6
- - [x] then remove `#licenses_from_files` from `{maven,gradle}_package.rb`
7
- - [x] update docs in package.rb to reflect what our expectations are.
8
- - [x] commit the rest of the WIP
9
-
2
+ - Packages should log which licenses came from decisions. Maybe have
3
+ Activations, which store a license and a source, which can be logged or
4
+ otherwise manipulated.
10
5
 
11
6
  # architecture
12
7
 
13
- - [x] package managers should use instance methods so we can inject things like loggers
14
- - [ ] are we sprinkling database logic around too much? see 23f4cae for related work.
15
-
16
-
17
8
  # renamings, etc.
18
9
 
19
- - [x] retitle the shared example "it conforms to interface required by PackageSaver"
20
- - [x] shared specs should go into a separate file(s)
21
- - [ ] classes under `package_managers` should be in a PackageManagers module
22
- - [ ] `license_names_from_standard_spec` should be the default instance method
23
- - [ ] #groups in some Packages, #included_groups etc. in others
24
-
10
+ - classes under `package_managers` should be in a PackageManagers module
11
+ - `license_names_from_standard_spec` should be the default instance method
25
12
 
26
13
  # docs
27
14
 
28
- - [ ] specify gradle version >= 1.8
15
+ - specify gradle version >= 1.8
@@ -1,7 +1,7 @@
1
- #! /usr/bin/env python
1
+ #!/usr/bin/env python
2
2
 
3
3
  import json
4
- from pip.util import get_installed_distributions
4
+ from pip.utils import get_installed_distributions
5
5
 
6
6
  packages = []
7
7
 
@@ -5,39 +5,39 @@ describe "License Finder command line executable" do
5
5
  # I want a command-line interface
6
6
  # So that I can manage my application's dependencies and licenses
7
7
 
8
- let(:user) { LicenseFinder::TestingDSL::User.new }
8
+ let(:developer) { LicenseFinder::TestingDSL::User.new }
9
9
 
10
10
  specify "reports unapproved dependencies" do
11
- user.create_empty_project
12
- user.execute_command("license_finder dependencies add unapproved_gem Whatever")
11
+ developer.create_empty_project
12
+ developer.execute_command("license_finder dependencies add unapproved_gem Whatever")
13
13
 
14
- user.run_license_finder
15
- expect(user).to be_receiving_exit_code(1)
16
- expect(user).to be_seeing 'unapproved_gem'
14
+ developer.run_license_finder
15
+ expect(developer).to be_receiving_exit_code(1)
16
+ expect(developer).to be_seeing 'unapproved_gem'
17
17
  end
18
18
 
19
19
  specify "reports that all dependencies are approved" do
20
- user.create_empty_project
20
+ developer.create_empty_project
21
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'
22
+ developer.run_license_finder
23
+ expect(developer).to be_receiving_exit_code(0)
24
+ expect(developer).to be_seeing 'All dependencies are approved for use'
25
25
  end
26
26
 
27
27
  specify "shows usage and subcommand help" do
28
- user.create_empty_project
28
+ developer.create_empty_project
29
29
 
30
- user.execute_command "license_finder help"
31
- expect(user).to be_seeing 'license_finder help [COMMAND]'
30
+ developer.execute_command "license_finder help"
31
+ expect(developer).to be_seeing 'license_finder help [COMMAND]'
32
32
 
33
- user.execute_command "license_finder ignored_groups help add"
34
- expect(user).to be_seeing 'license_finder ignored_groups add GROUP'
33
+ developer.execute_command "license_finder ignored_groups help add"
34
+ expect(developer).to be_seeing 'license_finder ignored_groups add GROUP'
35
35
  end
36
36
 
37
37
  it "reports `license_finder`'s license is MIT" do
38
- user.create_ruby_app # has license_finder as a dependency
38
+ developer.create_ruby_app # has license_finder as a dependency
39
39
 
40
- user.run_license_finder
41
- expect(user).to be_seeing_something_like /license_finder.*MIT/
40
+ developer.run_license_finder
41
+ expect(developer).to be_seeing_something_like /license_finder.*MIT/
42
42
  end
43
43
  end
@@ -3,35 +3,35 @@ require 'feature_helper'
3
3
  describe "Manually Added Dependencies" do
4
4
  # As a developer
5
5
  # I want to be able to manually add dependencies
6
- # So that I can track dependencies not managed by Bundler, NPM, etc.
6
+ # So that I can track dependencies not managed by any official package manager
7
7
 
8
- let(:user) { LicenseFinder::TestingDSL::User.new }
8
+ let(:developer) { LicenseFinder::TestingDSL::User.new }
9
9
 
10
- before { user.create_empty_project }
10
+ before { developer.create_empty_project }
11
11
 
12
12
  specify "appear in reports" do
13
- user.execute_command 'license_finder dependencies add manual_dep MIT 1.2.3'
13
+ developer.execute_command 'license_finder dependencies add manual_dep MIT 1.2.3'
14
14
 
15
- user.run_license_finder
16
- expect(user).to be_seeing 'manual_dep, 1.2.3, MIT'
15
+ developer.run_license_finder
16
+ expect(developer).to be_seeing 'manual_dep, 1.2.3, MIT'
17
17
  end
18
18
 
19
19
  specify "can be simultaneously approved" do
20
- user.execute_command 'license_finder dependencies add --approve manual Whatever'
20
+ developer.execute_command 'license_finder dependencies add --approve manual Whatever'
21
21
 
22
- user.run_license_finder
23
- expect(user).not_to be_seeing 'manual_dep'
22
+ developer.run_license_finder
23
+ expect(developer).not_to be_seeing 'manual_dep'
24
24
  end
25
25
 
26
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'
27
+ developer.execute_command 'license_finder dependencies add manual_dep Whatever'
28
+ expect(developer).to be_seeing 'manual_dep'
29
29
 
30
- user.execute_command 'license_finder dependencies list'
31
- expect(user).to be_seeing 'manual_dep'
30
+ developer.execute_command 'license_finder dependencies list'
31
+ expect(developer).to be_seeing 'manual_dep'
32
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'
33
+ developer.execute_command 'license_finder dependencies remove manual_dep'
34
+ developer.execute_command 'license_finder dependencies list'
35
+ expect(developer).to_not be_seeing 'manual_dep'
36
36
  end
37
37
  end
@@ -2,24 +2,25 @@ require 'feature_helper'
2
2
 
3
3
  describe "Manually Approved Dependencies" do
4
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
5
+ # I want to approve dependencies without whitelisting their licenses
6
+ # So that my business can track individual dependencies which it has approved
7
7
 
8
- let(:user) { LicenseFinder::TestingDSL::User.new }
8
+ let(:developer) { LicenseFinder::TestingDSL::User.new }
9
+ let(:product_owner) { LicenseFinder::TestingDSL::User.new }
9
10
 
10
11
  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'"
12
+ developer.create_empty_project
13
+ developer.execute_command 'license_finder dependencies add manual_dep MIT 1.2.3'
14
+ developer.execute_command "license_finder approval add manual_dep --who 'Julian' --why 'We really need this'"
14
15
  end
15
16
 
16
17
  specify "do not appear in action items" do
17
- user.run_license_finder
18
- expect(user).to_not be_seeing "manual_dep"
18
+ developer.run_license_finder
19
+ expect(developer).to_not be_seeing "manual_dep"
19
20
  end
20
21
 
21
22
  specify "include approval detail in reports" do
22
- html = user.view_html
23
+ html = product_owner.view_html
23
24
  expect(html).to be_approved 'manual_dep'
24
25
 
25
26
  html.in_dep("manual_dep") do |section|
@@ -2,19 +2,19 @@ require 'feature_helper'
2
2
 
3
3
  describe "Manually Assigned Licenses" do
4
4
  # As a developer
5
- # I want to be able to override the licenses license_finder finds
5
+ # I want to be able to override the licenses which license_finder finds
6
6
  # So that my dependencies all have the correct licenses
7
7
 
8
- let(:user) { LicenseFinder::TestingDSL::User.new }
8
+ let(:developer) { LicenseFinder::TestingDSL::User.new }
9
9
 
10
10
  specify "are shown in reports" do
11
- project = user.create_ruby_app
12
- gem = user.create_gem 'mislicensed_dep', license: 'Unknown'
11
+ project = developer.create_ruby_app
12
+ gem = developer.create_gem 'mislicensed_dep', license: 'Unknown'
13
13
  project.depend_on gem
14
- user.execute_command 'license_finder licenses add mislicensed_dep Known'
14
+ developer.execute_command 'license_finder licenses add mislicensed_dep Known'
15
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/
16
+ developer.run_license_finder
17
+ expect(developer).not_to be_seeing_something_like /mislicensed_dep.*Unknown/
18
+ expect(developer).to be_seeing_something_like /mislicensed_dep.*Known/
19
19
  end
20
20
  end
@@ -5,31 +5,31 @@ describe "Ignored Dependencies" do
5
5
  # I want to ignore certain dependencies
6
6
  # To avoid frequently changing reports about dependencies I know will always be approved
7
7
 
8
- let(:user) { LicenseFinder::TestingDSL::User.new }
8
+ let(:developer) { LicenseFinder::TestingDSL::User.new }
9
9
 
10
10
  before do
11
- user.create_empty_project
12
- user.execute_command 'license_finder dependencies add ignored_dep Whatever'
11
+ developer.create_empty_project
12
+ developer.execute_command 'license_finder dependencies add ignored_dep Whatever'
13
13
  end
14
14
 
15
15
  specify "are excluded from reports" do
16
- user.execute_command 'license_finder ignored_dependencies add ignored_dep'
16
+ developer.execute_command 'license_finder ignored_dependencies add ignored_dep'
17
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'
18
+ developer.run_license_finder
19
+ expect(developer).to_not be_seeing 'ignored_dep'
20
+ developer.execute_command('license_finder report')
21
+ expect(developer).to_not be_seeing 'ignored_dep'
22
22
  end
23
23
 
24
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'
25
+ developer.execute_command 'license_finder ignored_dependencies add ignored_dep'
26
+ expect(developer).to be_seeing 'ignored_dep'
27
27
 
28
- user.execute_command 'license_finder ignored_dependencies list'
29
- expect(user).to be_seeing 'ignored_dep'
28
+ developer.execute_command 'license_finder ignored_dependencies list'
29
+ expect(developer).to be_seeing 'ignored_dep'
30
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'
31
+ developer.execute_command 'license_finder ignored_dependencies remove ignored_dep'
32
+ developer.execute_command 'license_finder ignored_dependencies list'
33
+ expect(developer).to_not be_seeing 'ignored_dep'
34
34
  end
35
35
  end
@@ -3,29 +3,29 @@ require 'feature_helper'
3
3
  describe "Ignored Groups" do
4
4
  # As a developer
5
5
  # I want to ignore certain groups
6
- # So that any gems I use in development, or for testing, are automatically approved for use
6
+ # So that license_finder skips any gems I use in development, or for testing
7
7
 
8
- let(:user) { LicenseFinder::TestingDSL::User.new }
8
+ let(:developer) { LicenseFinder::TestingDSL::User.new }
9
9
 
10
10
  specify "are excluded from reports" do
11
- project = user.create_ruby_app
12
- gem = user.create_gem 'dev_gem', license: 'GPL'
11
+ project = developer.create_ruby_app
12
+ gem = developer.create_gem 'dev_gem', license: 'GPL'
13
13
  project.depend_on gem, groups: ['dev']
14
- user.execute_command 'license_finder ignored_group add dev'
14
+ developer.execute_command 'license_finder ignored_group add dev'
15
15
 
16
- user.run_license_finder
17
- expect(user).to_not be_seeing 'dev_gem'
16
+ developer.run_license_finder
17
+ expect(developer).to_not be_seeing 'dev_gem'
18
18
  end
19
19
 
20
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'
21
+ developer.create_empty_project
22
+ developer.execute_command 'license_finder ignored_group add dev'
23
+ expect(developer).to be_seeing 'dev'
24
+ developer.execute_command 'license_finder ignored_group list'
25
+ expect(developer).to be_seeing 'dev'
26
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'
27
+ developer.execute_command 'license_finder ignored_group remove dev'
28
+ developer.execute_command 'license_finder ignored_group list'
29
+ expect(developer).to_not be_seeing 'dev'
30
30
  end
31
31
  end
@@ -3,30 +3,31 @@ require 'feature_helper'
3
3
  describe "Project name" do
4
4
  # As a developer
5
5
  # I want to assign a name for my project
6
- # So that the reports show it
6
+ # So that product owners see it in the reports
7
7
 
8
- let(:user) { LicenseFinder::TestingDSL::User.new }
8
+ let(:developer) { LicenseFinder::TestingDSL::User.new }
9
+ let(:product_owner) { LicenseFinder::TestingDSL::User.new }
9
10
 
10
- before { user.create_empty_project }
11
+ before { developer.create_empty_project }
11
12
 
12
13
  specify "appears in the HTML report" do
13
- user.execute_command 'license_finder project_name add changed_name'
14
+ developer.execute_command 'license_finder project_name add changed_name'
14
15
 
15
- expect(user.view_html).to be_titled 'changed_name'
16
+ expect(product_owner.view_html).to be_titled 'changed_name'
16
17
  end
17
18
 
18
19
  specify "defaults to the directory name" do
19
- expect(user.view_html).to be_titled 'my_app'
20
+ expect(product_owner.view_html).to be_titled 'my_app'
20
21
  end
21
22
 
22
23
  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'
24
+ developer.execute_command 'license_finder project_name add my_proj'
25
+ expect(developer).to be_seeing 'my_proj'
26
+ developer.execute_command 'license_finder project_name show'
27
+ expect(developer).to be_seeing 'my_proj'
28
+
29
+ developer.execute_command 'license_finder project_name remove'
30
+ developer.execute_command 'license_finder project_name show'
31
+ expect(developer).to_not be_seeing 'my_proj'
31
32
  end
32
33
  end