Sha256: c05a3d16c9aed54ad5059564c2a7ca0fa6720b34b48fdf48f3fcce8bc74842ee

Contents?: true

Size: 1.28 KB

Versions: 2

Compression:

Stored size: 1.28 KB

Contents

Feature: Access STDERR of command

  You may need to `#stop_all_commands` before accessing `#stderr` 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/cli" with:
    """bash
    #!/bin/bash
    echo 'Hello, Aruba!' >&2
    """
    And a file named "spec/run_spec.rb" with:
    """ruby
    require 'spec_helper'

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

  Scenario: Waiting for output to "appear" after 2 seconds
    Given an executable named "bin/cli" with:
    """bash
    #!/bin/bash
    sleep 1
    echo 'Hello, Aruba' >&2
    """
    And a file named "spec/run_spec.rb" with:
    """ruby
    require 'spec_helper'

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aruba-0.14.9 features/api/command/stderr.feature
aruba-0.14.8 features/api/command/stderr.feature