Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2331)

Unified Diff: pkg/unittest/test/with_test_environment_test.dart

Issue 750543004: pkg/unittest: fix test after last change (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/with_test_environment_test.dart
diff --git a/pkg/unittest/test/with_test_environment_test.dart b/pkg/unittest/test/with_test_environment_test.dart
index ae35c206de5aa4d45fb81689a41a0f6b8000516b..8d28993e47e5fd09d28eb5e795d052a9357a81fd 100644
--- a/pkg/unittest/test/with_test_environment_test.dart
+++ b/pkg/unittest/test/with_test_environment_test.dart
@@ -33,8 +33,7 @@ class TestConfiguration extends SimpleConfiguration {
}
Future runUnittests(Function callback) {
- var config = new TestConfiguration();
- unittestConfiguration = config;
+ TestConfiguration config = unittestConfiguration = new TestConfiguration();
callback();
return config.done;
@@ -51,16 +50,11 @@ void runTests1() {
// Test that we can run two different sets of tests in the same run using the
// withTestEnvironment method.
void main() {
- // First check that we cannot call runUnittests twice in a row without it
- // throwing a StateError due to the unittestConfiguration being set globally
- // in the first call.
- try {
- runUnittests(runTests);
- runUnittests(runTests1);
- throw 'Expected this to be unreachable since 2nd run above should throw';
- } on StateError catch (error) {
- // expected, silently ignore.
- }
+ // Check that setting config a second time does not change the configuration
+ runUnittests(runTests);
+ var config = unittestConfiguration;
+ runUnittests(runTests1);
+ expect(config, unittestConfiguration);
// Test that we can run both when encapsulating in their own private test
// environment. Also test that the tests actually running are the ones
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698