features/upload_command.feature in berkshelf-3.0.0.beta1 vs features/upload_command.feature in berkshelf-3.0.0.beta2
- old
+ new
@@ -98,11 +98,11 @@
source "http://localhost:26210"
"""
When I run `berks upload reset`
Then the output should contain:
"""
- Failed to upload cookbook 'reset'. Not defined in Berksfile.
+ Could not find cookbook(s) 'reset' in any of the configured dependencies. Is it in your Berksfile?
"""
And the exit status should be "DependencyNotFound"
Scenario: specifying multiple cookbooks to upload
Given the cookbook store has the cookbooks:
@@ -279,5 +279,49 @@
And I successfully run `berks upload fake`
Then the output should contain:
"""
Uploading fake (0.0.0)
"""
+
+ Scenario: When the cookbook already exist
+ Given the cookbook store has the cookbooks:
+ | fake | 1.0.0 |
+ And the Chef Server has frozen cookbooks:
+ | fake | 1.0.0 |
+ And I write to "Berksfile" with:
+ """
+ cookbook 'fake', '1.0.0'
+ """
+ When I successfully run `berks upload`
+ Then the output should contain:
+ """
+ Skipping fake (1.0.0) (already uploaded)
+ """
+ And the output should contain:
+ """
+ Skipped uploading some cookbooks because they already existed on the remote server. Re-run with the `--force` flag to force overwrite these cookbooks:
+
+ * fake (1.0.0)
+ """
+ And the exit status should be 0
+
+ Scenario: When the cookbook already exist and is a metadata location
+ Given a cookbook named "fake"
+ And the cookbook "fake" has the file "Berksfile" with:
+ """
+ metadata
+ """
+ When I cd to "fake"
+ And the Chef Server has frozen cookbooks:
+ | fake | 0.0.0 |
+ When I run `berks upload`
+ Then the output should contain:
+ """
+ building universe...
+ Using fake (0.0.0) path: '/home/travis/build/RiotGames/berkshelf/spec/tmp/aruba/fake'
+ Uploading fake (0.0.0) to: 'http://localhost:26310/'
+ Skipping fake (0.0.0) (already uploaded)
+ Skipped uploading some cookbooks because they already existed on the remote server. Re-run with the `--force` flag to force overwrite these cookbooks:
+
+ * fake (0.0.0)
+ """
+ And the exit status should be 0