-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: vastly simplify guinness2 by removing all context.
Almost everything that guinness does to keep track of suites and tests is now also handles by package test. So, instead of keeping tons of complex logic around, simply defer to package:test functions when possible. BREAKING CHANGE: `iit` and `ddescribe` NO LONGER modify which tests will run. Instead, they will mark those blocks with the tag "solo". To run only `iit` or `ddescribe` blocks, use the command line `pub run test --tags solo` (the same command you would use before, with the additional tags "solo"). See #1
- Loading branch information
Showing
24 changed files
with
43 additions
and
1,239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,14 @@ | ||
part of guinness2; | ||
|
||
class Guinness { | ||
Context _context = new Context(); | ||
dynamic matchers; | ||
SpecRunner _initSpecs; | ||
bool autoInit = true; | ||
|
||
Guinness({this.matchers, SpecRunner initSpecs}) | ||
: _initSpecs = initSpecs { | ||
_scheduleAutoInit(); | ||
Guinness({this.matchers}) { | ||
} | ||
|
||
SpyFunction createSpy([String name]) => new SpyFunction(name); | ||
|
||
SpyFunction spyOn(obj, String name) { | ||
throw "Not implemented"; | ||
} | ||
|
||
void initSpecs() { | ||
_initSpecs(_context.suite); | ||
} | ||
|
||
void resetContext([Context context]) { | ||
_context = context == null ? new Context() : context; | ||
} | ||
|
||
SuiteInfo suiteInfo() => _suiteInfo(_context.suite); | ||
|
||
void _scheduleAutoInit() { | ||
async.scheduleMicrotask(() { | ||
if (autoInit) initSpecs(); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.