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

Unified Diff: pkg/scheduled_test/test/descriptor/directory_test.dart

Issue 15682008: Allow DirectoryDescriptor.load to load a file next to a directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
Index: pkg/scheduled_test/test/descriptor/directory_test.dart
diff --git a/pkg/scheduled_test/test/descriptor/directory_test.dart b/pkg/scheduled_test/test/descriptor/directory_test.dart
index e54b1912d14bc35e38bea172fc8bcea1fda13aaf..65c9ba7d069d0249ae6fe772c3425a665c1a5c8c 100644
--- a/pkg/scheduled_test/test/descriptor/directory_test.dart
+++ b/pkg/scheduled_test/test/descriptor/directory_test.dart
@@ -291,14 +291,6 @@ void main() {
});
});
- expectTestsPass("directory().read() fails", () {
- test('test', () {
- var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
- expect(dir.read().toList(),
- throwsA(equals("Can't read the contents of 'dir': is a directory.")));
- });
- });
-
expectTestsPass("directory().load() fails to load a nested directory", () {
test('test', () {
var dir = d.dir('dir', [
@@ -309,8 +301,8 @@ void main() {
]);
expect(dir.load('subdir').toList(),
- throwsA(equals("Can't read the contents of 'subdir': is a "
- "directory.")));
+ throwsA(equals("Couldn't find a readable entry named 'subdir' within "
+ "'dir'.")));
});
});
@@ -344,8 +336,8 @@ void main() {
var dir = d.dir('dir', [d.file('name.txt', 'contents')]);
expect(dir.load('not-name.txt').toList(),
- throwsA(equals("Couldn't find an entry named 'not-name.txt' within "
- "'dir'.")));
+ throwsA(equals("Couldn't find a readable entry named 'not-name.txt' "
+ "within 'dir'.")));
});
});
@@ -358,8 +350,21 @@ void main() {
]);
expect(dir.load('name.txt').toList(),
- throwsA(equals("Found multiple entries named 'name.txt' within "
- "'dir'.")));
+ throwsA(equals("Found multiple readable entries named 'name.txt' "
+ "within 'dir'.")));
+ });
+ });
+
+ expectTestsPass("directory().load() loads a file next to a directory with "
Bob Nystrom 2013/06/04 15:45:53 "directory" -> "subdirectory"
nweiz 2013/06/04 18:26:45 Done.
+ "the same name", () {
+ test('test', () {
+ var dir = d.dir('dir', [
+ d.file('name', 'contents'),
+ d.dir('name', [d.file('subfile', 'contents')])
+ ]);
+
+ expect(byteStreamToString(dir.load('name')),
+ completion(equals('contents')));
});
});

Powered by Google App Engine
This is Rietveld 408576698