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

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

Issue 566093003: Create binstubs for executables when activating a package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 library pubspec_test; 1 library pubspec_test;
2 import 'dart:async'; 2 import 'dart:async';
3 import 'package:unittest/unittest.dart'; 3 import 'package:unittest/unittest.dart';
4 import '../lib/src/package.dart'; 4 import '../lib/src/package.dart';
5 import '../lib/src/pubspec.dart'; 5 import '../lib/src/pubspec.dart';
6 import '../lib/src/source.dart'; 6 import '../lib/src/source.dart';
7 import '../lib/src/source_registry.dart'; 7 import '../lib/src/source_registry.dart';
8 import '../lib/src/version.dart'; 8 import '../lib/src/version.dart';
9 import 'test_pub.dart'; 9 import 'test_pub.dart';
10 class MockSource extends Source { 10 class MockSource extends Source {
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 publish_to: none 379 publish_to: none
380 ''', sources); 380 ''', sources);
381 expect(pubspec.publishTo, equals("none")); 381 expect(pubspec.publishTo, equals("none"));
382 }); 382 });
383 test("throws on other strings", () { 383 test("throws on other strings", () {
384 expectPubspecException( 384 expectPubspecException(
385 'publish_to: http://bad.url:not-port', 385 'publish_to: http://bad.url:not-port',
386 (pubspec) => pubspec.publishTo); 386 (pubspec) => pubspec.publishTo);
387 }); 387 });
388 }); 388 });
389 group("executables", () {
390 test("defaults to an empty map if omitted", () {
391 var pubspec = new Pubspec.parse('', sources);
392 expect(pubspec.executables, isEmpty);
393 });
394 test("throws if not a map", () {
395 expectPubspecException(
396 'executables: not map',
397 (pubspec) => pubspec.executables);
398 });
399 test("throws if key is not a string", () {
400 expectPubspecException(
401 'executables: {123: value}',
402 (pubspec) => pubspec.executables);
403 });
404 test("throws if a key isn't a simple name", () {
405 expectPubspecException(
406 'executables: {funny/name: ok}',
407 (pubspec) => pubspec.executables);
408 });
409 test("throws if a value is not a string", () {
410 expectPubspecException(
411 'executables: {command: 123}',
412 (pubspec) => pubspec.executables);
413 });
414 test("throws if a value isn't a simple name", () {
415 expectPubspecException(
416 'executables: {command: funny_name/part}',
417 (pubspec) => pubspec.executables);
418 });
419 test("allows a null value", () {
420 var pubspec = new Pubspec.parse('''
421 executables:
422 command:
423 ''', sources);
424 expect(pubspec.executables['command'], isNull);
425 });
426 });
389 }); 427 });
390 } 428 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698