mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-23 21:13:35 +00:00
refactor(tests): replace MockLogger with MockObserver in scope tests to align with updated observer API
This commit is contained in:
@@ -120,8 +120,8 @@ void main() {
|
|||||||
expect(Scope(scope, observer: observer), isNotNull); // эквивалент
|
expect(Scope(scope, observer: observer), isNotNull); // эквивалент
|
||||||
});
|
});
|
||||||
test('closeSubScope removes subscope so next openSubScope returns new', () async {
|
test('closeSubScope removes subscope so next openSubScope returns new', () async {
|
||||||
final logger = MockLogger();
|
final observer = MockObserver();
|
||||||
final scope = Scope(null, logger: logger);
|
final scope = Scope(null, observer: observer);
|
||||||
final subScope = scope.openSubScope("child");
|
final subScope = scope.openSubScope("child");
|
||||||
expect(scope.openSubScope("child"), same(subScope));
|
expect(scope.openSubScope("child"), same(subScope));
|
||||||
await scope.closeSubScope("child");
|
await scope.closeSubScope("child");
|
||||||
@@ -295,7 +295,7 @@ void main() {
|
|||||||
expect(t.disposed, isTrue);
|
expect(t.disposed, isTrue);
|
||||||
});
|
});
|
||||||
test('scope.disposeAsync calls dispose on all unique disposables', () async {
|
test('scope.disposeAsync calls dispose on all unique disposables', () async {
|
||||||
final scope = Scope(null, logger: MockLogger());
|
final scope = Scope(null, observer: MockObserver());
|
||||||
scope.installModules([ModuleWithDisposable()]);
|
scope.installModules([ModuleWithDisposable()]);
|
||||||
final t1 = scope.resolve<TestDisposable>();
|
final t1 = scope.resolve<TestDisposable>();
|
||||||
final t2 = scope.resolve<AnotherDisposable>();
|
final t2 = scope.resolve<AnotherDisposable>();
|
||||||
|
|||||||
Reference in New Issue
Block a user