Class: Omnibot::Testing::StubBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/omnibot/testing.rb

Instance Method Summary collapse

Constructor Details

#initialize(agent_class) ⇒ StubBuilder

Returns a new instance of StubBuilder.



26
# File 'lib/omnibot/testing.rb', line 26

def initialize(agent_class) = @script = Testing.script_for(agent_class)

Instance Method Details

#then_extract(hash) ⇒ Object



38
39
40
41
# File 'lib/omnibot/testing.rb', line 38

def then_extract(hash)
  @script << [:reply, hash]
  self
end

#then_reply(text) ⇒ Object



33
34
35
36
# File 'lib/omnibot/testing.rb', line 33

def then_reply(text)
  @script << [:reply, text]
  self
end

#to_call_tool(name, **args) ⇒ Object



28
29
30
31
# File 'lib/omnibot/testing.rb', line 28

def to_call_tool(name, **args)
  @script << [:tool, name.to_s, args]
  self
end