OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 shelf_static.sample_test; | |
6 | |
7 import 'dart:async'; | 5 import 'dart:async'; |
8 import 'dart:io'; | 6 import 'dart:io'; |
9 | 7 |
10 import 'package:path/path.dart' as p; | 8 import 'package:path/path.dart' as p; |
11 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
12 | 10 |
13 import 'package:shelf/shelf.dart'; | 11 import 'package:shelf/shelf.dart'; |
14 import 'package:shelf_static/shelf_static.dart'; | 12 import 'package:shelf_static/shelf_static.dart'; |
15 | 13 |
16 import 'test_util.dart'; | 14 import 'test_util.dart'; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 var handler = createStaticHandler(_samplePath); | 81 var handler = createStaticHandler(_samplePath); |
84 | 82 |
85 return new Future.sync(() => handler(request)); | 83 return new Future.sync(() => handler(request)); |
86 } | 84 } |
87 | 85 |
88 String get _samplePath { | 86 String get _samplePath { |
89 var sampleDir = p.join(p.current, 'example', 'files'); | 87 var sampleDir = p.join(p.current, 'example', 'files'); |
90 assert(FileSystemEntity.isDirectorySync(sampleDir)); | 88 assert(FileSystemEntity.isDirectorySync(sampleDir)); |
91 return sampleDir; | 89 return sampleDir; |
92 } | 90 } |
OLD | NEW |