class
Cradare2::Transport::MockTransport
- Cradare2::Transport::MockTransport
- Cradare2::Transport::Base
- Reference
- Object
Overview
A mock transport for testing without requiring a live radare2 process.
Defined in:
cradare2/transport/mock.crConstructors
Instance Method Summary
-
#close : Nil
Closes the transport and releases any associated resources.
-
#closed? : Bool
Returns true if the transport has been closed.
-
#cmd(command : String) : String
Executes a command string in radare2 and returns the response string.
-
#default(&block : String -> String) : self
Sets a default fallback block when no handler matches.
- #history : Array(String)
-
#on(command : String, response : String) : self
Registers a mock response for an exact command string.
-
#on(command : String, &block : String -> String) : self
Registers a dynamic mock block handler for an exact command string.
-
#on(pattern : Regex, &block : String -> String) : self
Registers a mock dynamic block handler for a regex command match.
- #reset : Nil
Instance methods inherited from class Cradare2::Transport::Base
close : Nil
close,
closed? : Bool
closed?,
cmd(command : String) : String
cmd,
timeout : Time::Span | Nil
timeout,
timeout=(timeout : Time::Span | Nil)
timeout=
Constructor Detail
Instance Method Detail
Closes the transport and releases any associated resources.
Returns true if the transport has been closed.
Executes a command string in radare2 and returns the response string.
Sets a default fallback block when no handler matches.
Registers a mock response for an exact command string.
Registers a dynamic mock block handler for an exact command string.
Registers a mock dynamic block handler for a regex command match.