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

Unified Diff: pkg/barback/test/asset_test.dart

Issue 18650004: Make Assets know their ID. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't make AssetSet implement Set<T>. Created 7 years, 5 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/barback/test/asset_test.dart
diff --git a/pkg/barback/test/asset_test.dart b/pkg/barback/test/asset_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..fb8b1624a5d21fa1aece3c25e7cd69b7c1c0c93e
--- /dev/null
+++ b/pkg/barback/test/asset_test.dart
@@ -0,0 +1,40 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library barback.test.asset_test;
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:barback/barback.dart';
+import 'package:unittest/unittest.dart';
+
+import 'utils.dart';
+
+main() {
+ initConfig();
+
+ var id = new AssetId.parse("package|path/to/asset.txt");
+
+ group("Asset.fromFile", () {
+ test("returns an asset with the given ID", () {
+ var asset = new Asset.fromFile(id, new File("asset.txt"));
+ expect(asset.id, equals(id));
+ });
+ });
+
+ group("Asset.fromPath", () {
+ test("returns an asset with the given ID", () {
+ var asset = new Asset.fromPath(id, "asset.txt");
+ expect(asset.id, equals(id));
+ });
+ });
+
+ group("Asset.fromString", () {
+ test("returns an asset with the given ID", () {
+ var asset = new Asset.fromString(id, "content");
+ expect(asset.id, equals(id));
+ });
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698