Sha256: 59622a876ea14bb05fd666d09b6e3e18ae096e6013896faa03132b742f84b774

Contents?: true

Size: 968 Bytes

Versions: 26

Compression:

Stored size: 968 Bytes

Contents

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/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('cli')).to match %r{tmp/aruba/cli-app/bin/cli} }
    end
    """
    When I run `rspec`
    Then the specs should all pass

  Scenario: Non-existing executable
    Given a file named "bin/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('cli')).to be_nil }
    end
    """
    When I run `rspec`
    Then the specs should all pass

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
aruba-0.14.9 features/api/command/which.feature
aruba-0.14.8 features/api/command/which.feature
aruba-0.14.7 features/api/command/which.feature
aruba-0.14.6 features/api/command/which.feature
aruba-0.14.5 features/api/command/which.feature
aruba-0.14.4 features/api/command/which.feature
aruba-0.14.3 features/api/command/which.feature
aruba-win-fix-0.14.2 features/api/command/which.feature
aruba-0.14.2 features/api/command/which.feature
aruba-0.14.1 features/api/command/which.feature
aruba-0.14.0 features/api/command/which.feature
aruba-0.13.0 features/api/command/which.feature
aruba-0.12.0 features/api/command/which.feature
aruba-0.11.2 features/api/command/which.feature
aruba-0.11.1 features/api/command/which.feature
aruba-0.11.0.pre4 features/api/command/which.feature
aruba-0.11.0.pre3 features/api/command/which.feature
aruba-0.11.0.pre2 features/api/command/which.feature
aruba-0.11.0.pre features/api/command/which.feature
aruba-0.10.2 features/api/command/which.feature