Module: StubShell

Defined in:
lib/stub_shell.rb,
lib/stub_shell/shell.rb,
lib/stub_shell/result.rb,
lib/stub_shell/command.rb,
lib/stub_shell/version.rb,
lib/stub_shell/test_helpers.rb

Defined Under Namespace

Modules: TestHelpers Classes: Command, Result, Shell

Constant Summary collapse

VERSION =
"0.0.2"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.current_contextObject

Returns the value of attribute current_context.



8
9
10
# File 'lib/stub_shell.rb', line 8

def current_context
  @current_context
end

Class Method Details

.run_command(cmd) ⇒ Object



10
11
12
13
14
# File 'lib/stub_shell.rb', line 10

def run_command cmd
  command, StubShell.current_context = StubShell.current_context.execute(cmd)
  Kernel.send(:`, "#{File.join(File.dirname(__FILE__), '..', 'bin', 'fake_process.sh')} '#{command.result.exitstatus}'")
  command
end