Class: Rspec::Shell::Expectations::CallLog

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/shell/expectations/call_log.rb

Overview

Log of calls to a command

Instance Method Summary collapse

Constructor Details

#initialize(call_log_path) ⇒ CallLog

Returns a new instance of CallLog.



6
7
8
# File 'lib/rspec/shell/expectations/call_log.rb', line 6

def initialize(call_log_path)
  @call_log_path = call_log_path
end

Instance Method Details

#called_with_args?(*args) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
# File 'lib/rspec/shell/expectations/call_log.rb', line 14

def called_with_args?(*args)
  return true if find_call(*args)
  false
end

#exist?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/rspec/shell/expectations/call_log.rb', line 10

def exist?
  @call_log_path.exist?
end

#stdin_for_args(*args) ⇒ Object



19
20
21
22
23
# File 'lib/rspec/shell/expectations/call_log.rb', line 19

def stdin_for_args(*args)
  call = find_call(*args)
  return call['stdin'] if call
  nil
end