| Index: utils/tests/pub/lock_file_test.dart
|
| diff --git a/utils/tests/pub/lock_file_test.dart b/utils/tests/pub/lock_file_test.dart
|
| index eeef7bf2716de40682bf8346148958fd0d90bb6a..70ac80822dbb6ee0329d5f7104d8afb49d5fd427 100644
|
| --- a/utils/tests/pub/lock_file_test.dart
|
| +++ b/utils/tests/pub/lock_file_test.dart
|
| @@ -17,8 +17,10 @@ class MockSource extends Source {
|
| final String name = 'mock';
|
| final bool shouldCache = false;
|
|
|
| - void validateDescription(String description, {bool fromLockFile: false}) {
|
| + dynamic parseDescription(String filePath, String description,
|
| + {bool fromLockFile: false}) {
|
| if (!description.endsWith(' desc')) throw new FormatException();
|
| + return description;
|
| }
|
|
|
| String packageName(String description) {
|
| @@ -35,17 +37,17 @@ main() {
|
| group('LockFile', () {
|
| group('parse()', () {
|
| test('returns an empty lockfile if the contents are empty', () {
|
| - var lockFile = new LockFile.parse('', sources);
|
| + var lockFile = new LockFile.parse(null, '', sources);
|
| expect(lockFile.packages.length, equals(0));
|
| });
|
|
|
| test('returns an empty lockfile if the contents are whitespace', () {
|
| - var lockFile = new LockFile.parse(' \t\n ', sources);
|
| + var lockFile = new LockFile.parse(null, ' \t\n ', sources);
|
| expect(lockFile.packages.length, equals(0));
|
| });
|
|
|
| test('parses a series of package descriptions', () {
|
| - var lockFile = new LockFile.parse('''
|
| + var lockFile = new LockFile.parse(null, '''
|
| packages:
|
| bar:
|
| version: 1.2.3
|
| @@ -74,7 +76,7 @@ packages:
|
|
|
| test("throws if the version is missing", () {
|
| expect(() {
|
| - new LockFile.parse('''
|
| + new LockFile.parse(null, '''
|
| packages:
|
| foo:
|
| source: mock
|
| @@ -85,7 +87,7 @@ packages:
|
|
|
| test("throws if the version is invalid", () {
|
| expect(() {
|
| - new LockFile.parse('''
|
| + new LockFile.parse(null, '''
|
| packages:
|
| foo:
|
| version: vorpal
|
| @@ -97,7 +99,7 @@ packages:
|
|
|
| test("throws if the source is missing", () {
|
| expect(() {
|
| - new LockFile.parse('''
|
| + new LockFile.parse(null, '''
|
| packages:
|
| foo:
|
| version: 1.2.3
|
| @@ -108,7 +110,7 @@ packages:
|
|
|
| test("throws if the source is unknown", () {
|
| expect(() {
|
| - new LockFile.parse('''
|
| + new LockFile.parse(null, '''
|
| packages:
|
| foo:
|
| version: 1.2.3
|
| @@ -120,7 +122,7 @@ packages:
|
|
|
| test("throws if the description is missing", () {
|
| expect(() {
|
| - new LockFile.parse('''
|
| + new LockFile.parse(null, '''
|
| packages:
|
| foo:
|
| version: 1.2.3
|
| @@ -131,7 +133,7 @@ packages:
|
|
|
| test("throws if the description is invalid", () {
|
| expect(() {
|
| - new LockFile.parse('''
|
| + new LockFile.parse(null, '''
|
| packages:
|
| foo:
|
| version: 1.2.3
|
| @@ -142,7 +144,7 @@ packages:
|
| });
|
|
|
| test("ignores extra stuff in file", () {
|
| - var lockFile = new LockFile.parse('''
|
| + var lockFile = new LockFile.parse(null, '''
|
| extra:
|
| some: stuff
|
| packages:
|
|
|