features/commands/list.feature in berkshelf-3.0.0.beta6 vs features/commands/list.feature in berkshelf-3.0.0.beta7

- old
+ new

@@ -1,56 +1,78 @@ Feature: berks list - Scenario: Running the list command + Scenario: When everything is good Given the cookbook store has the cookbooks: | fake1 | 1.0.0 | | fake2 | 1.0.1 | And I have a Berksfile pointing at the local Berkshelf API with: """ cookbook 'fake1', '1.0.0' cookbook 'fake2', '1.0.1' """ - And the Lockfile has: - | fake1 | 1.0.0 | - | fake2 | 1.0.1 | + And I write to "Berksfile.lock" with: + """ + DEPENDENCIES + fake1 (= 1.0.0) + fake2 (= 1.0.1) + + GRAPH + fake1 (1.0.0) + fake2 (1.0.1) + """ When I successfully run `berks list` Then the output should contain: """ Cookbooks installed by your Berksfile: * fake1 (1.0.0) * fake2 (1.0.1) """ - Scenario: Running the list command when the dependencies aren't downloaded - And I have a Berksfile pointing at the local Berkshelf API with: + Scenario: When the lockfile is not present + Given I have a Berksfile pointing at the local Berkshelf API with: """ cookbook 'fake', '1.0.0' """ - And the Lockfile has: - | fake | 1.0.0 | When I run `berks list` Then the output should contain: """ - Could not find cookbook 'fake (1.0.0)'. + Lockfile not found! Run `berks install` to create the lockfile. """ - And the exit status should be "CookbookNotFound" + And the exit status should be "LockfileNotFound" - Scenario: Running the list command when the lockfile isn't present - Given the cookbook store has the cookbooks: - | fake | 1.0.0 | - And I have a Berksfile pointing at the local Berkshelf API with: + Scenario: When a dependency is not in the lockfile + Given I have a Berksfile pointing at the local Berkshelf API with: """ cookbook 'fake', '1.0.0' """ + And I write to "Berksfile.lock" with: + """ + DEPENDENCIES + + GRAPH + not_fake (1.0.0) + """ When I run `berks list` Then the output should contain: """ - Could not find cookbook 'fake (= 1.0.0)'. + The lockfile is out of sync! Run `berks install` to sync the lockfile. """ - And the exit status should be "CookbookNotFound" + And the exit status should be "LockfileOutOfSync" - Scenario: Running the list command with no dependencies defined - Given I have a Berksfile pointing at the local Berkshelf API - When I successfully run `berks list` + Scenario: When a dependency is not installed + Given I have a Berksfile pointing at the local Berkshelf API with: + """ + cookbook 'fake', '1.0.0' + """ + And I write to "Berksfile.lock" with: + """ + DEPENDENCIES + fake (= 1.0.0) + + GRAPH + fake (1.0.0) + """ + When I run `berks list` Then the output should contain: """ - There are no cookbooks installed by your Berksfile + The cookbook 'fake (1.0.0)' is not installed. Please run `berks install` to download and install the missing dependency. """ + And the exit status should be "DependencyNotInstalled"