| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'package:path/path.dart' as path; | 5 import 'package:path/path.dart' as path; |
| 6 import 'package:pub/src/entrypoint.dart'; | 6 import 'package:pub/src/entrypoint.dart'; |
| 7 import 'package:pub/src/io.dart'; | 7 import 'package:pub/src/io.dart'; |
| 8 import 'package:pub/src/validator.dart'; | 8 import 'package:pub/src/validator.dart'; |
| 9 import 'package:pub/src/validator/license.dart'; | 9 import 'package:pub/src/validator/license.dart'; |
| 10 import 'package:scheduled_test/scheduled_test.dart'; | 10 import 'package:scheduled_test/scheduled_test.dart'; |
| 11 | 11 |
| 12 import '../descriptor.dart' as d; | 12 import '../descriptor.dart' as d; |
| 13 import '../test_pub.dart'; | 13 import '../test_pub.dart'; |
| 14 import 'utils.dart'; | 14 import 'utils.dart'; |
| 15 | 15 |
| 16 Validator license(Entrypoint entrypoint) => new LicenseValidator(entrypoint); | 16 Validator license(Entrypoint entrypoint) => new LicenseValidator(entrypoint); |
| 17 | 17 |
| 18 main() { | 18 main() { |
| 19 initConfig(); | |
| 20 | |
| 21 group('should consider a package valid if it', () { | 19 group('should consider a package valid if it', () { |
| 22 setUp(d.validPackage.create); | 20 setUp(d.validPackage.create); |
| 23 | 21 |
| 24 integration('looks normal', () => expectNoValidationError(license)); | 22 integration('looks normal', () => expectNoValidationError(license)); |
| 25 | 23 |
| 26 integration('has a COPYING file', () { | 24 integration('has a COPYING file', () { |
| 27 schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE'))); | 25 schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE'))); |
| 28 d.file(path.join(appPath, 'COPYING'), '').create(); | 26 d.file(path.join(appPath, 'COPYING'), '').create(); |
| 29 expectNoValidationError(license); | 27 expectNoValidationError(license); |
| 30 }); | 28 }); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 42 }); | 40 }); |
| 43 }); | 41 }); |
| 44 | 42 |
| 45 integration('should consider a package invalid if it has no LICENSE file', | 43 integration('should consider a package invalid if it has no LICENSE file', |
| 46 () { | 44 () { |
| 47 d.validPackage.create(); | 45 d.validPackage.create(); |
| 48 schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE'))); | 46 schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'LICENSE'))); |
| 49 expectValidationError(license); | 47 expectValidationError(license); |
| 50 }); | 48 }); |
| 51 } | 49 } |
| OLD | NEW |