Class: Cog::SpecHelpers::Runner
- Inherits:
-
Object
- Object
- Cog::SpecHelpers::Runner
- Defined in:
- lib/cog/spec_helpers/runner.rb
Overview
Points to the cog
command-line app
Instance Method Summary collapse
-
#initialize(exec_path = nil, opt = {}) ⇒ Runner
constructor
A new instance of Runner.
-
#run(*args) ⇒ Invocation
Run cog with the given arguments.
Constructor Details
#initialize(exec_path = nil, opt = {}) ⇒ Runner
Returns a new instance of Runner.
12 13 14 15 16 17 18 19 20 |
# File 'lib/cog/spec_helpers/runner.rb', line 12 def initialize(exec_path = nil, opt={}) @exec_path = if exec_path exec_path else File. File.join(File.dirname(__FILE__), '..', '..', '..', 'bin', 'cog') end @flags = opt[:flags] || ['--colorless'] @use_bundler = opt[:use_bundler].nil? ? true : opt[:use_bundler] end |
Instance Method Details
#run(*args) ⇒ Invocation
Run cog with the given arguments
25 26 27 28 |
# File 'lib/cog/spec_helpers/runner.rb', line 25 def run(*args) cmd = ([@exec_path] + @flags + args).collect &:to_s Invocation.new(cmd, :use_bundler => @use_bundler) end |