Skip to content

Instantly share code, notes, and snippets.

@jferris
Created March 26, 2014 19:44
Show Gist options
  • Select an option

  • Save jferris/9791591 to your computer and use it in GitHub Desktop.

Select an option

Save jferris/9791591 to your computer and use it in GitHub Desktop.
Cocaine PATH issue
require 'bundler/setup'
require 'cocaine'
require 'posix-spawn'
require 'rspec'
Cocaine::CommandLine.path = File.dirname(__FILE__)
[
Cocaine::CommandLine::BackticksRunner,
Cocaine::CommandLine::PopenRunner,
Cocaine::CommandLine::PosixRunner,
Cocaine::CommandLine::ProcessRunner
].each do |runner_class|
describe runner_class do
describe '#run' do
it 'finds executables from the supplemental environment path' do
Cocaine::CommandLine.runner = runner_class.new
result = Cocaine::CommandLine.new('ls').run
expect(result.strip).to eq('overridden ls')
end
end
end
end
source 'https://rubygems.org'
ruby '2.0.0'
gem 'cocaine'
gem 'posix-spawn'
gem 'rspec'
GEM
remote: https://rubygems.org/
specs:
activesupport (4.0.4)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
atomic (1.1.16)
climate_control (0.0.3)
activesupport (>= 3.0)
cocaine (0.5.3)
climate_control (>= 0.0.3, < 1.0)
diff-lcs (1.2.5)
i18n (0.6.9)
minitest (4.7.5)
multi_json (1.9.2)
posix-spawn (0.3.8)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
thread_safe (0.3.1)
atomic (>= 1.1.7, < 2)
tzinfo (0.3.39)
PLATFORMS
ruby
DEPENDENCIES
cocaine
posix-spawn
rspec
#!/bin/bash
printf "overridden ls\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment