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

Unified Diff: test/command_runner_test.dart

Issue 1985883002: UsageException isn't called UsageError. (Closed) Base URL: git@github.com:dart-lang/args@master
Patch Set: Created 4 years, 7 months 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 | « pubspec.yaml ('k') | test/command_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/command_runner_test.dart
diff --git a/test/command_runner_test.dart b/test/command_runner_test.dart
index 9961e7dc84e1d6b4df165e65d5021c6e34d4e4c8..d6605a4d96600e0ec6fa4a8b6e414525c3973daf 100644
--- a/test/command_runner_test.dart
+++ b/test/command_runner_test.dart
@@ -139,7 +139,7 @@ Run "test help <command>" for more information about a command."""));
test("usageException splits up the message and usage", () {
expect(() => runner.usageException("message"),
- throwsUsageError("message", _DEFAULT_USAGE));
+ throwsUsageException("message", _DEFAULT_USAGE));
});
group("run()", () {
@@ -262,7 +262,7 @@ Also, footer!"""));
});
test("includes the footer in usage errors", () {
- expect(runner.run(["--bad"]), throwsUsageError(
+ expect(runner.run(["--bad"]), throwsUsageException(
'Could not find an option named "bad".',
"$_DEFAULT_USAGE\nAlso, footer!"));
});
@@ -270,19 +270,19 @@ Also, footer!"""));
group("throws a useful error when", () {
test("arg parsing fails", () {
- expect(runner.run(["--bad"]), throwsUsageError(
+ expect(runner.run(["--bad"]), throwsUsageException(
'Could not find an option named "bad".', _DEFAULT_USAGE));
});
test("a top-level command doesn't exist", () {
- expect(runner.run(["bad"]), throwsUsageError(
+ expect(runner.run(["bad"]), throwsUsageException(
'Could not find a command named "bad".', _DEFAULT_USAGE));
});
test("a subcommand doesn't exist", () {
runner.addCommand(new FooCommand()..addSubcommand(new AsyncCommand()));
- expect(runner.run(["foo bad"]), throwsUsageError(
+ expect(runner.run(["foo bad"]), throwsUsageException(
'Could not find a command named "foo bad".', """
Usage: test <command> [arguments]
@@ -299,7 +299,7 @@ Run "test help <command>" for more information about a command."""));
test("a subcommand wasn't passed", () {
runner.addCommand(new FooCommand()..addSubcommand(new AsyncCommand()));
- expect(runner.run(["foo"]), throwsUsageError(
+ expect(runner.run(["foo"]), throwsUsageException(
'Missing subcommand for "test foo".', """
Usage: test foo <subcommand> [arguments]
-h, --help Print this usage information.
@@ -313,7 +313,7 @@ Run "test help" to see global options."""));
test("a command that doesn't take arguments was given them", () {
runner.addCommand(new FooCommand());
- expect(runner.run(["foo", "bar"]), throwsUsageError(
+ expect(runner.run(["foo", "bar"]), throwsUsageException(
'Command "foo" does not take any arguments.', """
Usage: test foo [arguments]
-h, --help Print this usage information.
« no previous file with comments | « pubspec.yaml ('k') | test/command_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698