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

Unified Diff: utils/tests/pub/pub_test.dart

Issue 14297021: Move pub into sdk/lib/_internal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Disallow package: imports of pub. Created 7 years, 8 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 | « utils/tests/pub/pub_cache_test.dart ('k') | utils/tests/pub/pub_uploader_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/pub_test.dart
diff --git a/utils/tests/pub/pub_test.dart b/utils/tests/pub/pub_test.dart
deleted file mode 100644
index 36071ba35302a136e300aa13aa5884095a3f7070..0000000000000000000000000000000000000000
--- a/utils/tests/pub/pub_test.dart
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library pub_tests;
-
-import 'dart:io';
-
-import 'package:scheduled_test/scheduled_test.dart';
-
-import 'descriptor.dart' as d;
-import 'test_pub.dart';
-
-final USAGE_STRING = """
- Pub is a package manager for Dart.
-
- Usage: pub command [arguments]
-
- Global options:
- -h, --help Print this usage information.
- --version Print pub version.
- --[no-]trace Print debugging information when an error occurs.
- --verbosity Control output verbosity.
-
- [all] Show all output including internal tracing messages.
- [io] Also show IO operations.
- [normal] Show errors, warnings, and user messages.
- [solver] Show steps during version resolution.
-
- -v, --verbose Shortcut for "--verbosity=all"
-
- Available commands:
- cache Inspect the system cache.
- help Display help information for Pub.
- install Install the current package's dependencies.
- publish Publish the current package to pub.dartlang.org.
- update Update the current package's dependencies to the latest versions.
- uploader Manage uploaders for a package on pub.dartlang.org.
- version Print pub version.
-
- Use "pub help [command]" for more information about a command.
- """;
-
-final VERSION_STRING = '''
- Pub 0.1.2+3
- ''';
-
-main() {
- initConfig();
-
- integration('running pub with no command displays usage', () {
- schedulePub(args: [], output: USAGE_STRING);
- });
-
- integration('running pub with just --help displays usage', () {
- schedulePub(args: ['--help'], output: USAGE_STRING);
- });
-
- integration('running pub with just -h displays usage', () {
- schedulePub(args: ['-h'], output: USAGE_STRING);
- });
-
- integration('running pub with just --version displays version', () {
- schedulePub(args: ['--version'], output: VERSION_STRING);
- });
-
- integration('an unknown command displays an error message', () {
- schedulePub(args: ['quylthulg'],
- error: '''
- Could not find a command named "quylthulg".
- Run "pub help" to see available commands.
- ''',
- exitCode: 64);
- });
-
- integration('an unknown option displays an error message', () {
- schedulePub(args: ['--blorf'],
- error: '''
- Could not find an option named "blorf".
- Run "pub help" to see available options.
- ''',
- exitCode: 64);
- });
-
- integration('an unknown command option displays an error message', () {
- // TODO(rnystrom): When pub has command-specific options, a more precise
- // error message would be good here.
- schedulePub(args: ['version', '--blorf'],
- error: '''
- Could not find an option named "blorf".
- Use "pub help" for more information.
- ''',
- exitCode: 64);
- });
-
- group('help', () {
- integration('shows help for a command', () {
- schedulePub(args: ['help', 'install'],
- output: '''
- Install the current package's dependencies.
-
- Usage: pub install
- ''');
- });
-
- integration('shows help for a command', () {
- schedulePub(args: ['help', 'publish'],
- output: '''
- Publish the current package to pub.dartlang.org.
-
- Usage: pub publish [options]
- -n, --dry-run Validate but do not publish the package
- -f, --force Publish without confirmation if there are no errors
- --server The package server to which to upload this package
- (defaults to "https://pub.dartlang.org")
- ''');
- });
-
- integration('an unknown help command displays an error message', () {
- schedulePub(args: ['help', 'quylthulg'],
- error: '''
- Could not find a command named "quylthulg".
- Run "pub help" to see available commands.
- ''',
- exitCode: 64);
- });
-
- });
-
- group('version', () {
- integration('displays the current version', () {
- schedulePub(args: ['version'], output: VERSION_STRING);
- });
-
- integration('parses a release-style version', () {
- d.dir(sdkPath, [
- d.file('version', '0.1.2.0_r17645'),
- ]).create();
-
- schedulePub(args: ['version'], output: "Pub 0.1.2+0.r17645\n");
- });
-
- integration('parses a dev-only style version', () {
- // The "version" file generated on developer builds is a little funky and
- // we need to make sure we don't choke on it.
- d.dir(sdkPath, [
- d.file('version', '0.1.2.0_r16279_bobross'),
- ]).create();
-
- schedulePub(args: ['version'], output: "Pub 0.1.2+0.r16279.bobross\n");
- });
- });
-}
« no previous file with comments | « utils/tests/pub/pub_cache_test.dart ('k') | utils/tests/pub/pub_uploader_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698