Top Level Namespace

Defined Under Namespace

Modules: StubShell

Instance Method Summary collapse

Instance Method Details

#`(cmd) ⇒ Object



20
21
22
# File 'lib/stub_shell.rb', line 20

def `(cmd)
  run_command(cmd).result.stdout
end

#run_command(cmd) ⇒ Object



14
15
16
17
18
# File 'lib/stub_shell.rb', line 14

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

#system(cmd) ⇒ Object



24
25
26
# File 'lib/stub_shell.rb', line 24

def system(cmd)
  run_command(cmd).result.exitstatus == 0
end