features/licenses.feature in berkshelf-2.0.18 vs features/licenses.feature in berkshelf-3.0.0.beta1

- old
+ new

@@ -1,16 +1,22 @@ Feature: Installing cookbooks with specific licenses As a user I want to ensure my company only uses cookbooks that fall in our legal realm So that I can safely install and legally use community cookbooks + Background: + Given the Berkshelf API server's cache is empty + And the Chef Server is empty + And the cookbook store is empty + Scenario: With licenses defined Given the cookbook store has the cookbooks: | berkshelf-cookbook-fixture | 0.1.0 | mit | And I write to "Berksfile" with: """ - site :opscode + source "http://localhost:26210" + cookbook 'berkshelf-cookbook-fixture', '~> 0.1' """ And I have a Berkshelf config file containing: """ { @@ -20,18 +26,18 @@ When I successfully run `berks install` Then the output should not contain: """ is not in your list of allowed licenses """ - And the exit status should be 0 Scenario: With a license that is not listed Given the cookbook store has the cookbooks: | berkshelf-cookbook-fixture | 0.1.0 | mit | And I write to "Berksfile" with: """ - site :opscode + source "http://localhost:26210" + cookbook 'berkshelf-cookbook-fixture', '~> 0.1' """ And I have a Berkshelf config file containing: """ { @@ -41,18 +47,18 @@ When I successfully run `berks install` Then the output should contain: """ 'mit' is not in your list of allowed licenses """ - And the exit status should be 0 Scenario: With raise_license_exception defined Given the cookbook store has the cookbooks: | berkshelf-cookbook-fixture | 0.1.0 | mit | And I write to "Berksfile" with: """ - site :opscode + source "http://localhost:26210" + cookbook 'berkshelf-cookbook-fixture', '~> 0.1' """ And I have a Berkshelf config file containing: """ { @@ -63,18 +69,18 @@ When I successfully run `berks install` Then the output should not contain: """ is not in your list of allowed licenses """ - And the exit status should be 0 Scenario: With a license that is not listed Given the cookbook store has the cookbooks: | berkshelf-cookbook-fixture | 0.1.0 | mit | And I write to "Berksfile" with: """ - site :opscode + source "http://localhost:26210" + cookbook 'berkshelf-cookbook-fixture', '~> 0.1' """ And I have a Berkshelf config file containing: """ { @@ -85,28 +91,28 @@ When I run `berks install` Then the output should contain: """ 'mit' is not in your list of allowed licenses """ - And the CLI should exit with the status code for error "LicenseNotAllowed" + And the exit status should be "LicenseNotAllowed" Scenario: With a :path location Given the cookbook store has the cookbooks: | fake | 0.1.0 | mit | And I write to "Berksfile" with: """ - site :opscode - cookbook 'fake', path: '../berkshelf/cookbooks/fake-0.1.0' + source "http://localhost:26210" + + cookbook 'fake', path: '../../spec/tmp/berkshelf/cookbooks/fake-0.1.0' """ And I have a Berkshelf config file containing: """ { "allowed_licenses": ["apache2"], "raise_license_exception": true } """ - When I run `berks install` + When I successfully run `berks install` Then the output should not contain: """ 'mit' is not in your list of allowed licenses """ - And the exit status should be 0