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

Side by Side Diff: sdk/lib/_internal/pub/test/build/warns_on_assets_paths_test.dart

Issue 141113011: Support directories other than "web" in pub build. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 library pub_tests; 5 library pub_tests;
6 6
7 import 'package:path/path.dart' as path; 7 import 'package:path/path.dart' as path;
8 8
9 import '../../lib/src/utils.dart'; 9 import '../../lib/src/utils.dart';
10 import '../descriptor.dart' as d; 10 import '../descriptor.dart' as d;
(...skipping 14 matching lines...) Expand all
25 d.dir(appPath, [ 25 d.dir(appPath, [
26 d.appPubspec(), 26 d.appPubspec(),
27 d.dir('web', [ 27 d.dir('web', [
28 d.file('index.html'), 28 d.file('index.html'),
29 d.dir('assets') 29 d.dir('assets')
30 ]) 30 ])
31 ]).create(); 31 ]).create();
32 32
33 var assetsPath = path.join('web', 'assets'); 33 var assetsPath = path.join('web', 'assets');
34 schedulePub(args: ['build'], 34 schedulePub(args: ['build'],
35 error: getWarningRegExp(assetsPath), 35 error: getWarningRegExp(assetsPath));
36 exitCode: 0);
37 }); 36 });
38 37
39 integration('warns user about assets dir nested anywhere in "web"', () { 38 integration('warns user about assets dir nested anywhere in "web"', () {
40 d.dir(appPath, [ 39 d.dir(appPath, [
41 d.appPubspec(), 40 d.appPubspec(),
42 d.dir('web', [ 41 d.dir('web', [
43 d.file('index.html'), 42 d.file('index.html'),
44 d.dir('foo', [ 43 d.dir('foo', [
45 d.dir('assets') 44 d.dir('assets')
46 ]) 45 ])
47 ]) 46 ])
48 ]).create(); 47 ]).create();
49 48
50 var assetsPath = path.join('web', 'foo', 'assets'); 49 var assetsPath = path.join('web', 'foo', 'assets');
51 schedulePub(args: ['build'], 50 schedulePub(args: ['build'],
52 error: getWarningRegExp(assetsPath), 51 error: getWarningRegExp(assetsPath));
53 exitCode: 0);
54 }); 52 });
55 53
56 integration('warns user about assets file in the root of "web"', () { 54 integration('warns user about assets file in the root of "web"', () {
57 d.dir(appPath, [ 55 d.dir(appPath, [
58 d.appPubspec(), 56 d.appPubspec(),
59 d.dir('web', [ 57 d.dir('web', [
60 d.file('index.html'), 58 d.file('index.html'),
61 d.file('assets') 59 d.file('assets')
62 ]) 60 ])
63 ]).create(); 61 ]).create();
64 62
65 var assetsPath = path.join('web', 'assets'); 63 var assetsPath = path.join('web', 'assets');
66 schedulePub(args: ['build'], 64 schedulePub(args: ['build'],
67 error: getWarningRegExp(assetsPath), 65 error: getWarningRegExp(assetsPath));
68 exitCode: 0);
69 }); 66 });
70 67
71 integration('warns user about assets file nested anywhere in "web"', () { 68 integration('warns user about assets file nested anywhere in "web"', () {
72 d.dir(appPath, [ 69 d.dir(appPath, [
73 d.appPubspec(), 70 d.appPubspec(),
74 d.dir('web', [ 71 d.dir('web', [
75 d.file('index.html'), 72 d.file('index.html'),
76 d.dir('foo', [ 73 d.dir('foo', [
77 d.file('assets') 74 d.file('assets')
78 ]) 75 ])
79 ]) 76 ])
80 ]).create(); 77 ]).create();
81 78
82 var assetsPath = path.join('web', 'foo', 'assets'); 79 var assetsPath = path.join('web', 'foo', 'assets');
83 schedulePub(args: ['build'], 80 schedulePub(args: ['build'],
84 error: getWarningRegExp(assetsPath), 81 error: getWarningRegExp(assetsPath));
85 exitCode: 0);
86 }); 82 });
87 83
88 integration('does not warn if no assets dir or file anywhere in "web"', () { 84 integration('does not warn if no assets dir or file anywhere in "web"', () {
89 d.dir(appPath, [ 85 d.dir(appPath, [
90 d.appPubspec(), 86 d.appPubspec(),
91 d.dir('web', [ 87 d.dir('web', [
92 d.file('index.html'), 88 d.file('index.html'),
93 d.dir('foo') 89 d.dir('foo')
94 ]) 90 ])
95 ]).create(); 91 ]).create();
96 92
97 schedulePub(args: ['build'], 93 schedulePub(args: ['build'],
98 error: new RegExp( 94 error: new RegExp(
99 r'^(?!Warning: Pub reserves paths containing "assets").*$'), 95 r'^(?!Warning: Pub reserves paths containing "assets").*$'));
100 exitCode: 0);
101 }); 96 });
102 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698