Sha256: 425432d83c8c8ebc94a7f44db4e44b0094e2d3e807e97bf06a38a85d046a7cfb

Contents?: true

Size: 956 Bytes

Versions: 6

Compression:

Stored size: 956 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:
    """
    #!/bin/bash
    exit 0
    """
    And a file named "spec/which_spec.rb" with:
    """
    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:
    """
    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

6 entries across 6 versions & 1 rubygems

Version Path
aruba-0.9.0.pre features/api/command/which.feature
aruba-0.8.1 features/api/command/which.feature
aruba-0.8.0 features/api/command/which.feature
aruba-0.8.0.pre3 features/api/command/which.feature
aruba-0.8.0.pre2 features/api/command/which.feature
aruba-0.8.0.pre features/api/command/which.feature