Sha256: 2a551644cf086f4befe8700bf1c1baf6d9be13f48dbc8902727cdc3fbaaf8d5c

Contents?: true

Size: 1.73 KB

Versions: 29

Compression:

Stored size: 1.73 KB

Contents

Feature: --format json
  As a user
  I want to be able to get all output in JSON format
  So I can easily parse the output in scripts

  Scenario: JSON output installing a cookbook from the default location
    Given I write to "Berksfile" with:
      """
      cookbook "mysql", "= 1.2.4"
      """
    When I run the install command with flags:
      | --format json |
    Then the output should be JSON
    And the JSON at "cookbooks" should have 2 cookbooks
    And the JSON at "cookbooks/0/version" should be "1.2.4"
    And the JSON at "cookbooks/0/location" should be "site: 'http://cookbooks.opscode.com/api/v1/cookbooks'"

  Scenario: JSON output installing a cookbook we already have
    Given the cookbook store has the cookbooks:
      | mysql   | 1.2.4 |
    And I write to "Berksfile" with:
      """
      cookbook "mysql", "= 1.2.4"
      """
    When I run the install command with flags:
      | --format json |
    Then the output should be JSON
    And the JSON at "cookbooks" should have 1 cookbook
    And the JSON at "cookbooks/0/version" should be "1.2.4"
    And the JSON should not have "cookbooks/0/location"

  @chef_server
  Scenario: JSON output when running the upload command
    Given a Berksfile with path location sources to fixtures:
      | example_cookbook | example_cookbook-0.5.0 |
    And the Chef server does not have the cookbooks:
      | example_cookbook | 0.5.0 |
    When I run the upload command with flags:
      | --format json |
    Then the output should be JSON
    And the JSON at "cookbooks" should have 1 cookbook
    And the JSON at "cookbooks/0/version" should be "0.5.0"
    And the JSON should have "cookbooks/0/uploaded_to"
    And the Chef server should have the cookbooks:
      | example_cookbook | 0.5.0 |

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
berkshelf-1.4.6 features/json_formatter.feature
berkshelf-1.4.5 features/json_formatter.feature
berkshelf-1.4.4 features/json_formatter.feature
berkshelf-1.4.3 features/json_formatter.feature
berkshelf-1.4.2 features/json_formatter.feature
berkshelf-1.4.1 features/json_formatter.feature
berkshelf-1.4.0 features/json_formatter.feature
berkshelf-1.4.0.rc1 features/json_formatter.feature
berkshelf-1.3.1 features/json_formatter.feature
berkshelf-1.3.0.rc1 features/json_formatter.feature
berkshelf-1.2.1 features/json_formatter.feature
berkshelf-1.2.0.rc1 features/json_formatter.feature
berkshelf-1.1.6 features/json_formatter.feature
berkshelf-1.1.5 features/json_formatter.feature
berkshelf-1.1.4 features/json_formatter.feature
berkshelf-1.1.3 features/json_formatter.feature
berkshelf-1.1.2 features/json_formatter.feature
berkshelf-1.1.1 features/json_formatter.feature
berkshelf-1.1.0 features/json_formatter.feature
berkshelf-1.1.0.rc1 features/json_formatter.feature