Class: BoltSpec::Plans::PublishStub

Inherits:
ActionStub show all
Defined in:
lib/bolt_spec/plans/publish_stub.rb

Instance Attribute Summary

Attributes inherited from ActionStub

#invocation

Instance Method Summary collapse

Methods inherited from ActionStub

#assert_called, #be_called_times, #check_plan_result, #check_resultset, #default_for, #expect_call, #initialize, #not_be_called, #with_targets

Constructor Details

This class inherits a constructor from BoltSpec::Plans::ActionStub

Instance Method Details

#always_return(_data) ⇒ Object



17
18
19
# File 'lib/bolt_spec/plans/publish_stub.rb', line 17

def always_return(_data)
  raise "always_return is not implemented for out module functions"
end

#call(_event) ⇒ Object



33
34
35
# File 'lib/bolt_spec/plans/publish_stub.rb', line 33

def call(_event)
  @calls += 1
end

#error_with(_data) ⇒ Object



21
22
23
# File 'lib/bolt_spec/plans/publish_stub.rb', line 21

def error_with(_data)
  raise "error_with is not implemented for out module functions"
end

#matches(message) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/bolt_spec/plans/publish_stub.rb', line 25

def matches(message)
  if @invocation[:options] && message != @invocation[:options]
    return false
  end

  true
end

#parametersObject



37
38
39
# File 'lib/bolt_spec/plans/publish_stub.rb', line 37

def parameters
  @invocation[:options]
end

#returnObject



9
10
11
# File 'lib/bolt_spec/plans/publish_stub.rb', line 9

def return
  raise "return is not implemented for out module functions"
end

#return_for_targets(_data) ⇒ Object



13
14
15
# File 'lib/bolt_spec/plans/publish_stub.rb', line 13

def return_for_targets(_data)
  raise "return_for_targets is not implemented for out module functions"
end

#with_params(params) ⇒ Object

Public methods



43
44
45
46
# File 'lib/bolt_spec/plans/publish_stub.rb', line 43

def with_params(params)
  @invocation[:options] = params
  self
end