Sha256: b1bf96fd8da08d59cdfca4f5710e48ef9caece00021ed059fbd0a80c28fa1267

Contents?: true

Size: 1.73 KB

Versions: 8

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"

  @slow_process
  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

8 entries across 8 versions & 1 rubygems

Version Path
berkshelf-0.6.0.beta2 features/json_formatter.feature
berkshelf-0.5.1 features/json_formatter.feature
berkshelf-0.6.0.beta1 features/json_formatter.feature
berkshelf-0.5.0 features/json_formatter.feature
berkshelf-0.5.0.rc4 features/json_formatter.feature
berkshelf-0.5.0.rc3 features/json_formatter.feature
berkshelf-0.5.0.rc2 features/json_formatter.feature
berkshelf-0.5.0.rc1 features/json_formatter.feature