Sha256: ad6a4753ebf0a83dbc562e833f0eda769eb8d0fc108d2f7237574752a846b23e

Contents?: true

Size: 1.32 KB

Versions: 5

Compression:

Stored size: 1.32 KB

Contents

@experimental
Feature: Replace variables

  There are use cases where you need access to some information from aruba in
  your command line. The `#replace_variables`-method makes this information
  available.

  Please note, this feature is experimental for now. The implementation of this
  feature and the name of variables may change without further notice.

  Background:
    Given I use a fixture named "cli-app"

  Scenario: PID of last command started
    Given an executable named "bin/aruba-test-cli" with:
    """
    #!/bin/bash
    exit 0
    """
    And a file named "spec/replace_spec.rb" with:
    """
    require 'spec_helper'

    RSpec.describe 'Run command', :type => :aruba do
      before(:each) { run_command('aruba-test-cli') }
      before(:each) { stop_all_commands }
 
      it { expect(replace_variables('<pid-last-command-started>')).to eq last_command_started.pid.to_s }
    end
    """
    When I run `rspec`
    Then the specs should all pass

  Scenario: No last command started
    Given a file named "spec/replace_spec.rb" with:
    """
    require 'spec_helper'

    RSpec.describe 'Run command', :type => :aruba do
      it { expect { replace_variables('<pid-last-command-started>') }.to raise_error Aruba::NoCommandHasBeenStartedError }
    end
    """
    When I run `rspec`
    Then the specs should all pass

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
aruba-0.14.14 features/04_aruba_api/text/replace_variables.feature
aruba-0.14.13 features/04_aruba_api/text/replace_variables.feature
aruba-0.14.12 features/04_aruba_api/text/replace_variables.feature
aruba-0.14.11 features/04_aruba_api/text/replace_variables.feature
aruba-0.14.10 features/04_aruba_api/text/replace_variables.feature