Index: test/chain/chain_test.dart |
diff --git a/test/chain/chain_test.dart b/test/chain/chain_test.dart |
index cddb4a623acb86e86911365714e403895d3cd9f4..40b06d55224fcd8d6811e471d257b09db4bd9963 100644 |
--- a/test/chain/chain_test.dart |
+++ b/test/chain/chain_test.dart |
@@ -36,6 +36,22 @@ void main() { |
}); |
}); |
+ group("Chain.capture() with when: false", () { |
+ test("with no onError doesn't block errors", () { |
+ expect(Chain.capture(() => new Future.error("oh no"), when: false), |
+ throwsA("oh no")); |
+ }); |
+ |
+ test("with onError blocks errors", () { |
+ Chain.capture(() { |
+ return new Future.error("oh no"); |
+ }, onError: expectAsync((error, chain) { |
+ expect(error, equals("oh no")); |
+ expect(chain, new isInstanceOf<Chain>()); |
+ }), when: false); |
+ }); |
+ }); |
+ |
test("toString() ensures that all traces are aligned", () { |
var chain = new Chain([ |
new Trace.parse('short 10:11 Foo.bar\n'), |