Sha256: 9c8bd29dfdf0e1df1d1ce4d490abaa703b0f35429287f60e5ad14d8a17a849e0

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

@no-clobber
Feature: vagrant-exec validations
  In order to avoid configuration mistakes for vagrant-exec commands
  As a user
  I should see proper validation errors

  Background:
    Given I write to "Vagrantfile" with:
      """
      $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
      require 'vagrant-exec'

      Vagrant.configure('2') do |config|
        config.vm.box = 'vagrant_exec'
        config.exec.commands true, directory: nil, prepend: true, env: 0
      end
      """

  Scenario: raises error if command is not string or array of strings
    When I run `bundle exec vagrant up`
    Then the exit status should not be 0
    And the output should contain "Commands should be String or Array<String>, received: true"

  Scenario: raises error if directory is improperly set
    When I run `bundle exec vagrant up`
    Then the exit status should not be 0
    And the output should contain ":directory should be String, received: nil"

  Scenario: raises error if prepend is improperly set
    When I run `bundle exec vagrant up`
    Then the exit status should not be 0
    And the output should contain ":prepend should be String, received: true"

  Scenario: raises error if environment variables are improperly set
    When I run `bundle exec vagrant up`
    Then the exit status should not be 0
    And the output should contain ":env should be Hash, received: 0"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-exec-0.4.0 features/vagrant-exec/validations.feature