To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!
More about adding a collaboratorGet 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"
- Scenarios
-
- 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
- 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
Last published over 7 years ago by Max Meyer.