Index: test/stub-modules/io.js |
diff --git a/test/stub-modules/io.js b/test/stub-modules/io.js |
index f9b0c2a1ae977a697181595df380ee2a62bfb691..1fd917dedf90b352c95f8f2119ae6777fb1242cd 100644 |
--- a/test/stub-modules/io.js |
+++ b/test/stub-modules/io.js |
@@ -1 +1,43 @@ |
-exports.IO = {}; |
+// |
+// Fake nsIFile implementation for our I/O |
+// |
+function FakeFile(path) |
+{ |
+ this.path = path; |
+} |
+FakeFile.prototype = |
+{ |
+ get leafName() |
+ { |
+ return this.path; |
+ }, |
+ set leafName(value) |
+ { |
+ this.path = value; |
+ }, |
+ append: function(path) |
+ { |
+ this.path += path; |
+ }, |
+ clone: function() |
+ { |
+ return new FakeFile(this.path); |
+ }, |
+ get parent() |
+ { |
+ return {create: function() {}}; |
+ }, |
+ normalize: function() {} |
+}; |
+ |
+ |
+exports.IO = { |
+ resolveFilePath: function(path) |
+ { |
+ return new FakeFile(path); |
+ }, |
+ statFile: function(path) |
+ { |
+ return true; |
+ } |
+}; |