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

Side by Side Diff: sdk/lib/_internal/pub/test/pubspec_test.dart

Issue 331593012: Add a "global activate" command to pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pubspec_test; 5 library pubspec_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
11 import '../lib/src/package.dart'; 11 import '../lib/src/package.dart';
12 import '../lib/src/pubspec.dart'; 12 import '../lib/src/pubspec.dart';
13 import '../lib/src/source.dart'; 13 import '../lib/src/source.dart';
14 import '../lib/src/source_registry.dart'; 14 import '../lib/src/source_registry.dart';
15 import '../lib/src/version.dart'; 15 import '../lib/src/version.dart';
16 import 'test_pub.dart'; 16 import 'test_pub.dart';
17 17
18 class MockSource extends Source { 18 class MockSource extends Source {
19 final String name = "mock"; 19 final String name = "mock";
20 20
21 Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError( 21 Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError(
22 "Cannot describe mock packages."); 22 "Cannot describe mock packages.");
23 23
24 Future ensureLocal(PackageId id) => throw new UnsupportedError(
25 "Cannot get a mock package.");
26
27 Future get(PackageId id, String symlink) => throw new UnsupportedError( 24 Future get(PackageId id, String symlink) => throw new UnsupportedError(
28 "Cannot get a mock package."); 25 "Cannot get a mock package.");
29 26
30 Future<String> getDirectory(PackageId id) => throw new UnsupportedError( 27 Future<String> getDirectory(PackageId id) => throw new UnsupportedError(
31 "Cannot get the directory for mock packages."); 28 "Cannot get the directory for mock packages.");
32 29
33 dynamic parseDescription(String filePath, description, 30 dynamic parseDescription(String filePath, description,
34 {bool fromLockFile: false}) { 31 {bool fromLockFile: false}) {
35 if (description != 'ok') throw new FormatException('Bad'); 32 if (description != 'ok') throw new FormatException('Bad');
36 return description; 33 return description;
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 (pubspec) => pubspec.environment); 408 (pubspec) => pubspec.environment);
412 }); 409 });
413 410
414 test("throws if the sdk isn't a valid version constraint", () { 411 test("throws if the sdk isn't a valid version constraint", () {
415 expectPubspecException('environment: {sdk: "oopies"}', 412 expectPubspecException('environment: {sdk: "oopies"}',
416 (pubspec) => pubspec.environment); 413 (pubspec) => pubspec.environment);
417 }); 414 });
418 }); 415 });
419 }); 416 });
420 } 417 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698