| Index: sdk/lib/_internal/pub/test/transformer/mode_defaults_to_debug_in_serve_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_debug_in_serve_test.dart
|
| similarity index 66%
|
| 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_debug_in_serve_test.dart
|
| index e84224573756be3b06fd10af820e12416241073f..f45b8da290f554a0ead2b0af4b032547b2df974f 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_debug_in_serve_test.dart
|
| @@ -6,9 +6,9 @@ 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';
|
| +import '../serve/utils.dart';
|
|
|
| final transformer = """
|
| import 'dart:async';
|
| @@ -16,17 +16,17 @@ 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 +34,7 @@ class ConfigTransformer extends Transformer {
|
|
|
| main() {
|
| initConfig();
|
| - integration("configuration defaults to an empty map", () {
|
| + integration("mode defaults to 'debug' in pub serve", () {
|
| d.dir(appPath, [
|
| d.pubspec({
|
| "name": "myapp",
|
| @@ -51,7 +51,7 @@ main() {
|
| createLockFile('myapp', pkg: ['barback']);
|
|
|
| var server = startPubServe();
|
| - requestShouldSucceed("foo.json", JSON.encode({}));
|
| + requestShouldSucceed("foo.txt", "debug");
|
| endPubServe();
|
| });
|
| }
|
|
|