Sha256: c7d2158430a16f5807b1cfcbf718382c30cfea41b6642785c1e71ade4d19c2ad

Contents?: true

Size: 1.3 KB

Versions: 5

Compression:

Stored size: 1.3 KB

Contents

Feature: Access STDOUT of command

  You may need to `#stop_all_commands` before accessing `#stdout` of a single
  command - e.g. `#last_command_started`.

  Background:
    Given I use a fixture named "cli-app"
    And the default aruba io wait timeout is 1 seconds

  Scenario: Existing executable
    Given an executable named "bin/aruba-test-cli" with:
    """bash
    #!/bin/bash
    echo 'Hello, Aruba!'
    """
    And a file named "spec/run_spec.rb" with:
    """ruby
    require 'spec_helper'

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

  Scenario: Waiting for output to appear
    Given an executable named "bin/aruba-test-cli" with:
    """bash
    #!/bin/bash
    sleep 0.1
    echo 'Hello, Aruba'
    """
    And a file named "spec/run_spec.rb" with:
    """ruby
    require 'spec_helper'

    RSpec.describe 'Run command', :type => :aruba, :io_wait_timeout => 0.2 do
      before(:each) { run_command('aruba-test-cli') }
      it { expect(last_command_started.stdout).to start_with 'Hello' }
    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/command/read_stdout_of_command.feature
aruba-0.14.13 features/04_aruba_api/command/read_stdout_of_command.feature
aruba-0.14.12 features/04_aruba_api/command/read_stdout_of_command.feature
aruba-0.14.11 features/04_aruba_api/command/read_stdout_of_command.feature
aruba-0.14.10 features/04_aruba_api/command/read_stdout_of_command.feature