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

- old
+ new

@@ -6,25 +6,27 @@ Scenario: With the old lockfile format Given the cookbook store has the cookbooks: | berkshelf-cookbook-fixture | 0.1.0 | And I write to "Berksfile" with: """ - site :opscode + source "http://localhost:26210" + cookbook 'berkshelf-cookbook-fixture', '~> 0.1' """ And I write to "Berksfile.lock" with: """ cookbook 'berkshelf-cookbook-fixture', :locked_version => '0.1.0' """ When I successfully run `berks update` - Then the output should contain "You are using the old lockfile format. Attempting to convert..." + Then the output should warn about the old lockfile format Then the file "Berksfile.lock" should contain JSON: """ { - "sources":{ + "dependencies":{ "berkshelf-cookbook-fixture":{ - "locked_version":"0.1.0" + "locked_version":"0.1.0", + "constraint":"~> 0.1" } } } """ @@ -33,37 +35,42 @@ | berkshelf-cookbook-fixture | 0.1.0 | | berkshelf-cookbook-fixture | 0.2.0 | | hostsfile | 1.0.1 | And I write to "Berksfile" with: """ - site :opscode + source "http://localhost:26210" + cookbook 'berkshelf-cookbook-fixture', '~> 0.1' cookbook 'hostsfile', '~> 1.0.0' """ And I write to "Berksfile.lock" with: """ { - "sources":{ + "dependencies":{ "berkshelf-cookbook-fixture":{ - "locked_version":"0.1.0" + "locked_version":"0.1.0", + "constraint":"~> 0.1" }, "hostsfile":{ - "locked_version":"1.0.1" + "locked_version":"1.0.1", + "constraint":"= 1.0.1" } } } """ When I successfully run `berks update` Then the file "Berksfile.lock" should contain JSON: """ { - "sources":{ + "dependencies":{ "berkshelf-cookbook-fixture":{ - "locked_version":"0.2.0" + "locked_version":"0.2.0", + "constraint":"~> 0.1" }, "hostsfile":{ - "locked_version":"1.0.1" + "locked_version":"1.0.1", + "constraint":"~> 1.0.0" } } } """ @@ -72,61 +79,68 @@ | berkshelf-cookbook-fixture | 0.1.0 | | berkshelf-cookbook-fixture | 0.2.0 | | hostsfile | 1.0.1 | Given I write to "Berksfile" with: """ - site :opscode + source "http://localhost:26210" + cookbook 'berkshelf-cookbook-fixture', '~> 0.1' cookbook 'hostsfile', '~> 1.0.0' """ And I write to "Berksfile.lock" with: """ { - "sources":{ + "dependencies":{ "berkshelf-cookbook-fixture":{ - "locked_version":"0.1.0" + "locked_version":"0.1.0", + "constraint":"~> 0.1" }, "hostsfile":{ - "locked_version":"1.0.0" + "locked_version":"1.0.0", + "constraint":"~> 1.0.0" } } } """ And I successfully run `berks update berkshelf-cookbook-fixture` Then the file "Berksfile.lock" should contain JSON: """ { - "sources":{ + "dependencies":{ "berkshelf-cookbook-fixture":{ - "locked_version":"0.2.0" + "locked_version":"0.2.0", + "constraint":"~> 0.1" }, "hostsfile":{ - "locked_version":"1.0.0" + "locked_version":"1.0.0", + "constraint":"~> 1.0.0" } } } """ Scenario: With a cookbook that does not exist Given the cookbook store has the cookbooks: | berkshelf-cookbook-fixture | 0.1.0 | Given I write to "Berksfile" with: """ - site :opscode + source "http://localhost:26210" + cookbook 'berkshelf-cookbook-fixture', '~> 0.1' """ Given I write to "Berksfile.lock" with: """ { - "sources":{ + "dependencies":{ "berkshelf-cookbook-fixture":{ - "locked_version":"0.1.0" + "locked_version":"0.1.0", + "constraint":"~> 0.1" } } } """ When I run `berks update non-existent-cookbook` Then the output should contain: """ - Could not find cookbooks 'non-existent-cookbook' in any of the sources. Is it in your Berksfile? + Could not find cookbook(s) 'non-existent-cookbook' in any of the configured dependencies. Is it in your Berksfile? """ - And the CLI should exit with the status code for error "CookbookNotFound" + And the exit status should be "CookbookNotFound"