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

Unified Diff: sdk/lib/_internal/pub/test/transformer/mode_defaults_to_release_in_build_test.dart

Issue 52853004: Pass in "mode" to transformer plugins. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: "transformer" -> "configuration". Created 7 years, 2 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 | « sdk/lib/_internal/pub/test/transformer/mode_defaults_to_debug_in_serve_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/transformer/mode_defaults_to_release_in_build_test.dart
diff --git a/sdk/lib/_internal/pub/test/transformer/configuration/configuration_defaults_to_empty_map_test.dart b/sdk/lib/_internal/pub/test/transformer/mode_defaults_to_release_in_build_test.dart
similarity index 59%
copy from sdk/lib/_internal/pub/test/transformer/configuration/configuration_defaults_to_empty_map_test.dart
copy to sdk/lib/_internal/pub/test/transformer/mode_defaults_to_release_in_build_test.dart
index e84224573756be3b06fd10af820e12416241073f..5109c82e690a19433de1634ce2c2c78c3057e4d4 100644
--- a/sdk/lib/_internal/pub/test/transformer/configuration/configuration_defaults_to_empty_map_test.dart
+++ b/sdk/lib/_internal/pub/test/transformer/mode_defaults_to_release_in_build_test.dart
@@ -4,29 +4,25 @@
library pub_tests;
-import 'dart:convert';
-
-import '../../descriptor.dart' as d;
-import '../../test_pub.dart';
-import '../../serve/utils.dart';
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
final transformer = """
import 'dart:async';
-import 'dart:convert';
import 'package:barback/barback.dart';
-class ConfigTransformer extends Transformer {
- final Map configuration;
+class ModeTransformer extends Transformer {
+ final BarbackSettings settings;
- ConfigTransformer.asPlugin(this.configuration);
+ ModeTransformer.asPlugin(this.settings);
String get allowedExtensions => '.txt';
Future apply(Transform transform) {
return transform.primaryInput.readAsString().then((contents) {
- var id = transform.primaryInput.id.changeExtension(".json");
- transform.addOutput(new Asset.fromString(id, JSON.encode(configuration)));
+ transform.addOutput(
+ new Asset.fromString(transform.primaryInput.id, settings.mode.name));
});
}
}
@@ -34,7 +30,7 @@ class ConfigTransformer extends Transformer {
main() {
initConfig();
- integration("configuration defaults to an empty map", () {
+ integration("mode defaults to 'release' in pub build", () {
d.dir(appPath, [
d.pubspec({
"name": "myapp",
@@ -50,8 +46,14 @@ main() {
createLockFile('myapp', pkg: ['barback']);
- var server = startPubServe();
- requestShouldSucceed("foo.json", JSON.encode({}));
- endPubServe();
+ schedulePub(args: ["build"],
+ output: new RegExp(r"Built 1 file!"),
+ exitCode: 0);
+
+ d.dir(appPath, [
+ d.dir('build', [
+ d.file('foo.txt', 'release')
+ ])
+ ]).validate();
});
}
« no previous file with comments | « sdk/lib/_internal/pub/test/transformer/mode_defaults_to_debug_in_serve_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698