class Rspec::Bash::StubbedCommand

Attributes

arguments[R]
command[R]

Public Class Methods

new(command, call_log_manager, call_conf_manager) click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 8
def initialize(command, call_log_manager, call_conf_manager)
  @command = command
  @arguments = []
  @call_log_manager = call_log_manager
  @call_conf_manager = call_conf_manager
end

Public Instance Methods

call_count(*args) click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 32
def call_count(*args)
  @call_log_manager.call_count(@command, args)
end
call_log() click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 50
def call_log
  @call_log_manager.call_log(@command)
end
called?() click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 20
def called?
  @call_log_manager.called_with_args?(@command, @arguments)
end
called_with_args?(*args) click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 28
def called_with_args?(*args)
  @call_log_manager.called_with_args?(@command, args)
end
called_with_no_args?() click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 24
def called_with_no_args?
  @call_log_manager.called_with_no_args?(@command)
end
inspect() click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 54
def inspect
  if @arguments.any?
    "<Stubbed #{@call_configuration.command.inspect} " \
      "args: #{@arguments.join(' ').inspect}>"
  else
    "<Stubbed #{@call_configuration.command.inspect}>"
  end
end
outputs(contents, to: :stdout) click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 45
def outputs(contents, to: :stdout)
  @call_conf_manager.add_output(@command, contents, to, @arguments)
  self
end
returns_exitstatus(exitcode) click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 40
def returns_exitstatus(exitcode)
  @call_conf_manager.set_exitcode(@command, exitcode, @arguments)
  self
end
stdin() click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 36
def stdin
  @call_log_manager.stdin_for_args(@command, @arguments)
end
with_args(*args) click to toggle source
# File lib/rspec/bash/command/stubbed_command.rb, line 15
def with_args(*args)
  @arguments = args
  self
end