File: find_command_in_PATH.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 (37 lines) | stat: -rw-r--r-- 1,023 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
Feature: Get path to command

  Sometimes you only know a commands name, but not where to find it. Here comes
  `which` to the rescue.

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

  Scenario: Existing executable
    Given an executable named "bin/aruba-test-cli" with:
    """bash
    #!/bin/bash
    exit 0
    """
    And a file named "spec/which_spec.rb" with:
    """ruby
    require 'spec_helper'

    RSpec.describe 'Find path for command', :type => :aruba do
      it { expect(which('aruba-test-cli')).to match %r{tmp/aruba/cli-app/bin/aruba-test-cli} }
    end
    """
    When I run `rspec`
    Then the specs should all pass

  Scenario: Non-existing executable
    Given a file named "bin/aruba-test-cli" does not exist
    And a file named "spec/which_spec.rb" with:
    """ruby
    require 'spec_helper'

    RSpec.describe 'Find path for command', :type => :aruba do
      it { expect(which('aruba-test-cli')).to be_nil }
    end
    """
    When I run `rspec`
    Then the specs should all pass