Sha256: d05fde1f2c1d8e075755913bd45f402ff71478f3ae03c7e811eb530449596edc

Contents?: true

Size: 1.88 KB

Versions: 28

Compression:

Stored size: 1.88 KB

Contents

Feature: Mock the HOME variable

  If you develop commandline applications, you might want to give your users
  the possibility to configure your program. Normally this is done via
  `.your-app-rc` or via `.config/your-app` an systems which comply to the
  freedesktop-specifications.

  To prevent to litter the developers HOME-directory `aruba` comes with a step
  which mocks the `HOME`-variable. It is set to the
  `aruba`-`working-directory`.

  Background:
    Given I use the fixture "cli-app"
    And an executable named "bin/cli" with:
    """
    #!/bin/bash

    echo "HOME: $HOME"
    """

  Scenario: Mocked home directory by using a step
    Given a file named "features/home_variable.feature" with:
    """
    Feature: Home Variable
      Scenario: Run command
        Given a mocked home directory
        When I run `cli`
        Then the output should match %r<HOME:.*tmp/aruba$>
    """
    When I run `cucumber`
    Then the features should all pass

  Scenario: Mocked home directory by using a tag
    Given a file named "features/home_variable.feature" with:
    """
    Feature: Home Variable
      @mocked-home-directory
      Scenario: Run command
        When I run `cli`
        Then the output should match %r<HOME:.*tmp/aruba$>
    """
    When I run `cucumber`
    Then the features should all pass

  Scenario: Redefine home directory by using the aruba configuration
    Given a file named "features/support/home_variable.rb" with:
    """
    require 'aruba/cucumber'

    Aruba.configure do |config|
      config.home_directory = File.join(config.root_directory, config.working_directory)
    end
    """
    Given a file named "features/home_variable.feature" with:
    """
    Feature: Home Variable
      Scenario: Run command
        When I run `cli`
        Then the output should match %r<HOME:.*tmp/aruba$>
    """
    When I run `cucumber`
    Then the features should all pass

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
aruba-0.14.9 features/steps/environment/home_variable.feature
aruba-0.14.8 features/steps/environment/home_variable.feature
aruba-0.14.7 features/steps/environment/home_variable.feature
aruba-0.14.6 features/steps/environment/home_variable.feature
aruba-0.14.5 features/steps/environment/home_variable.feature
aruba-0.14.4 features/steps/environment/home_variable.feature
aruba-0.14.3 features/steps/environment/home_variable.feature
aruba-win-fix-0.14.2 features/steps/environment/home_variable.feature
aruba-0.14.2 features/steps/environment/home_variable.feature
aruba-0.14.1 features/steps/environment/home_variable.feature
aruba-0.14.0 features/steps/environment/home_variable.feature
aruba-0.13.0 features/steps/environment/home_variable.feature
aruba-0.12.0 features/steps/environment/home_variable.feature
aruba-0.11.2 features/steps/environment/home_variable.feature
aruba-0.11.1 features/steps/environment/home_variable.feature
aruba-0.11.0.pre4 features/steps/environment/home_variable.feature
aruba-0.11.0.pre3 features/steps/environment/home_variable.feature
aruba-0.11.0.pre2 features/steps/environment/home_variable.feature
aruba-0.11.0.pre features/steps/environment/home_variable.feature
aruba-0.10.2 features/steps/environment/home_variable.feature