File: run_a_command.feature

package info (click to toggle)
ruby-aruba 2.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,972 kB
  • sloc: ruby: 7,151; javascript: 6,850; makefile: 5
file content (82 lines) | stat: -rw-r--r-- 2,105 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Feature: Run commands

  There are several steps to run commands with `aruba`.

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

  Scenario: Run command found in path
    Given an executable named "bin/aruba-test-cli" with:
    """
    #!/bin/bash
    exit 0
    """
    And a file named "features/run.feature" with:
    """
    Feature: Run it
      Scenario: Run command
        When I run `aruba-test-cli`
    """
    When I run `cucumber`
    Then the features should all pass

  Scenario: Activate desired announcers when running command fails
    Given an executable named "bin/aruba-test-cli" with:
    """
    #!/bin/bash
    echo "Hello, I'm STDOUT"
    exit 1
    """
    And a file named "features/run.feature" with:
    """
    Feature: Run it
      Scenario: Run command
        When I successfully run `aruba-test-cli`
    """
    And I append to "features/support/env.rb" with:
    """
    Before do
      aruba.config.activate_announcer_on_command_failure = [:stdout]
    end
    """
    When I run `cucumber`
    Then the features should not pass
    And the output should contain:
    """
    <<-STDOUT
    Hello, I'm STDOUT

    STDOUT
    """

  Scenario: Run command found in "bin"-directory which is found in the current directory
    Given a file named "features/run.feature" with:
    """
    Feature: Run it

    Scenario: Run command
      Given an executable named "bin/local_cli" with:
      \"\"\"
      #!/bin/bash
      exit 0
      \"\"\"
      When I successfully run `bin/local_cli`
    """
    When I run `cucumber`
    Then the features should all pass

  Scenario: Run command found in "bin"-directory which is found in the current directory
    Given a file named "features/run.feature" with:
    """
    Feature: Run it
      Scenario: Run command
        Given an executable named "bin/local_cli" with:
        \"\"\"
        #!/bin/bash
        exit 0
        \"\"\"
        And I look for executables in "bin" within the current directory
        When I successfully run `local_cli`
    """
    When I run `cucumber`
    Then the features should all pass