features/contingent_command.feature in berkshelf-2.0.0.beta vs features/contingent_command.feature in berkshelf-2.0.0
- old
+ new
@@ -1,18 +1,47 @@
-Feature: contingent command
+Feature: Running the contingent command
As a user with a Berksfile
I want a way to the cookbooks that depend on another
So that I can better understand my infrastructure
- @slow_process
- Scenario: Running the contingent command against a cookbook
- Given I write to "Berksfile" with:
+ Scenario: When there are dependent cookbooks
+ Given the cookbook store has the cookbooks:
+ | dep | 1.0.0 |
+ And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
+ | dep | ~> 1.0.0 |
+ And the cookbook store contains a cookbook "ekaf" "1.0.0" with dependencies:
+ | dep | ~> 1.0.0 |
+ And I write to "Berksfile" with:
"""
- cookbook 'berkshelf-cookbook-fixture', '1.0.0', github: 'RiotGames/berkshelf-cookbook-fixture', branch: 'deps'
+ cookbook 'fake', '1.0.0'
+ cookbook 'ekaf', '1.0.0'
"""
- And I successfully run `berks contingent hostsfile`
+ And I successfully run `berks contingent dep`
Then the output should contain:
"""
- Cookbooks contingent upon hostsfile:
- * berkshelf-cookbook-fixture (1.0.0)
+ Cookbooks in this Berksfile contingent upon dep:
+ * ekaf (1.0.0)
+ * fake (1.0.0)
"""
And the exit status should be 0
+
+ Scenario: When there are no dependent cookbooks
+ Given the cookbook store has the cookbooks:
+ | fake | 1.0.0 |
+ And I write to "Berksfile" with:
+ """
+ cookbook 'fake', '1.0.0'
+ """
+ And I successfully run `berks contingent dep`
+ Then the output should contain:
+ """
+ There are no cookbooks contingent upon 'dep' defined in this Berksfile
+ """
+ And the exit status should be 0
+
+ Scenario: When the cookbook is not in the Berksfile
+ Given an empty file named "Berksfile"
+ And I successfully run `berks contingent dep`
+ Then the output should contain:
+ """
+ There are no cookbooks contingent upon 'dep' defined in this Berksfile
+ """