class RSpec::Bash::Mocks::Doubles::FunctionDouble

Public Class Methods

new(routine) click to toggle source
# File lib/rspec/bash/mocks/doubles/function_double.rb, line 6
def initialize(routine)
  super()

  @routine = routine
end

Public Instance Methods

apply(script) click to toggle source
# File lib/rspec/bash/mocks/doubles/function_double.rb, line 12
def apply(script)
  script.stub(@routine,
    call_original: call_original,
    behaviors: behaviors,
    subshell: subshell,
  )
end
call_args(script) click to toggle source
# File lib/rspec/bash/mocks/doubles/function_double.rb, line 24
def call_args(script)
  script.calls_for(@routine).map { |x| x[:args] }
end
call_count(script) click to toggle source
# File lib/rspec/bash/mocks/doubles/function_double.rb, line 20
def call_count(script)
  script.calls_for(@routine).count
end
to_s() click to toggle source
# File lib/rspec/bash/mocks/doubles/function_double.rb, line 28
def to_s
  @routine.to_s
end