class Rspec::Bash::CallLog
Attributes
call_log[RW]
Public Class Methods
new()
click to toggle source
# File lib/rspec/bash/command/call_log.rb, line 6 def initialize @call_log = [] end
Public Instance Methods
add_log(stdin, argument_list)
click to toggle source
# File lib/rspec/bash/command/call_log.rb, line 35 def add_log(stdin, argument_list) updated_log = @call_log updated_log << { args: argument_list, stdin: stdin } end
call_count(argument_list)
click to toggle source
# File lib/rspec/bash/command/call_log.rb, line 16 def call_count(argument_list) call_argument_list_matcher = Util::CallLogArgumentListMatcher.new(argument_list) call_argument_list_matcher.get_call_count(call_log) end
call_log_arguments()
click to toggle source
# File lib/rspec/bash/command/call_log.rb, line 43 def call_log_arguments @call_log.map { |call_log| call_log[:args] || [] }.compact end
called_with_args?(argument_list)
click to toggle source
# File lib/rspec/bash/command/call_log.rb, line 21 def called_with_args?(argument_list) call_argument_list_matcher = Util::CallLogArgumentListMatcher.new(argument_list) call_argument_list_matcher.args_match?(call_log) end
called_with_no_args?()
click to toggle source
# File lib/rspec/bash/command/call_log.rb, line 26 def called_with_no_args? return false if @call_log.empty? @call_log.all? do |call_log| argument_list = call_log[:args] || [] argument_list.empty? end end
stdin_for_args(argument_list)
click to toggle source
# File lib/rspec/bash/command/call_log.rb, line 10 def stdin_for_args(argument_list) call_argument_list_matcher = Util::CallLogArgumentListMatcher.new(argument_list) matching_call_log_list = call_argument_list_matcher.get_call_log_matches(call_log) matching_call_log_list.first[:stdin] unless matching_call_log_list.empty? end