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

Unified Diff: test/validator/dependency_override_test.dart

Issue 2276143002: Loosen dependency override validation. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 4 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 | « lib/src/validator/dependency_override.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/validator/dependency_override_test.dart
diff --git a/test/validator/dependency_override_test.dart b/test/validator/dependency_override_test.dart
index 3373bc73f39596dadc35c931e823c13a84f0e081..7d0f0aa9ba73ee0517059bfdad49620e0f33ed8e 100644
--- a/test/validator/dependency_override_test.dart
+++ b/test/validator/dependency_override_test.dart
@@ -5,6 +5,7 @@
import 'package:pub/src/entrypoint.dart';
import 'package:pub/src/validator.dart';
import 'package:pub/src/validator/dependency_override.dart';
+import 'package:scheduled_test/scheduled_test.dart';
import '../descriptor.dart' as d;
import '../test_pub.dart';
@@ -14,16 +15,52 @@ Validator dependencyOverride(Entrypoint entrypoint) =>
new DependencyOverrideValidator(entrypoint);
main() {
- integration('invalidates a package if it has dependency overrides', () {
+ integration('should consider a package valid if it has dev dependency '
+ 'overrides', () {
d.dir(appPath, [
d.pubspec({
"name": "myapp",
+ "dev_dependencies": {
+ "foo": "1.0.0"
+ },
"dependency_overrides": {
"foo": "<3.0.0"
}
})
]).create();
- expectValidationError(dependencyOverride);
+ expectNoValidationError(dependencyOverride);
+ });
+
+ group('should consider a package invalid if', () {
+ integration('it has only non-dev dependency overrides', () {
+ d.dir(appPath, [
+ d.pubspec({
+ "name": "myapp",
+ "dependency_overrides": {
+ "foo": "<3.0.0"
+ }
+ })
+ ]).create();
+
+ expectValidationError(dependencyOverride);
+ });
+
+ integration('it has any non-dev dependency overrides', () {
+ d.dir(appPath, [
+ d.pubspec({
+ "name": "myapp",
+ "dev_dependencies": {
+ "foo": "1.0.0"
+ },
+ "dependency_overrides": {
+ "foo": "<3.0.0",
+ "bar": ">3.0.0",
+ }
+ })
+ ]).create();
+
+ expectValidationError(dependencyOverride);
+ });
});
}
« no previous file with comments | « lib/src/validator/dependency_override.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698