RealStubDriver class

Production StubDriver that delegates every call to the static StubLoader class.

For tests that need in-memory stubs without filesystem access, define a FakeStubDriver in the test file (it must NOT be exported from lib/).

Usage

final driver = RealStubDriver();
final content = driver.make('model', {'className': 'Monitor'});
Implemented types

Constructors

RealStubDriver()
Creates a RealStubDriver.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

load(String name, {List<String>? searchPaths}) String
Load a .stub file by name and return its raw content.
override
make(String name, Map<String, String> replacements) String
Load a stub and replace all placeholders in one step.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replace(String stub, Map<String, String> replacements) String
Replace all {{ key }} placeholders in stub with values from replacements.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited