Sha256: cd24f9904a5e1298a8bac96cc6210b26120c8d96506b956fbdee774f2fe7ffca

Contents?: true

Size: 1.96 KB

Versions: 5

Compression:

Stored size: 1.96 KB

Contents

Feature: Installing specific groups
  As a user
  I want to be able specify groups of cookbooks to include or exclude
  So I don't install cookbooks that are part of a group that I do not want to install

  Scenario: Using the --except option
    Given the cookbook store has the cookbooks:
      | default  | 1.0.0 |
      | takeme   | 1.0.0 |
    Given I write to "Berksfile" with:
      """
      group :notme do
        cookbook 'notme', '1.0.0'
      end

      cookbook 'default', '1.0.0'

      group :takeme do
        cookbook 'takeme', '1.0.0'
      end
      """
    When I successfully run `berks install --except notme`
    Then the output should contain:
      """
      Using default (1.0.0)
      Using takeme (1.0.0)
      """
    And the output should not contain "Using notme (1.0.0)"
    And the exit status should be 0

  Scenario: Using the --only option
    Given the cookbook store has the cookbooks:
      | takeme   | 1.0.0 |
    Given I write to "Berksfile" with:
      """
      group :notme do
        cookbook 'notme', '1.0.0'
      end

      cookbook 'default', '1.0.0'

      group :takeme do
        cookbook 'takeme', '1.0.0'
      end
      """
    When I successfully run `berks install --only takeme`
    Then the output should contain "Using takeme (1.0.0)"
    Then the output should not contain "Using notme (1.0.0)"
    Then the output should not contain "Using default (1.0.0)"
    And the exit status should be 0

  Scenario: Attempting to provide an only and except option
    Given I write to "Berksfile" with:
      """
      group :notme do
        cookbook 'nginx', '= 0.101.2'
      end

      cookbook 'berkshelf-cookbook-fixture', '1.0.0'

      group :takeme do
        cookbook 'hostsfile', '1.0.1'
      end
      """
    When I run `berks install --only takeme --except notme`
    Then the output should contain:
      """
      Cannot specify both :except and :only
      """
    And the CLI should exit with the status code for error "ArgumentError"

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
berkshelf-2.0.5 features/groups_install.feature
berkshelf-2.0.4 features/groups_install.feature
berkshelf-2.0.3 features/groups_install.feature
berkshelf-2.0.1 features/groups_install.feature
berkshelf-2.0.0 features/groups_install.feature