From d9bfa029b0ecf300ae47cf1033db2d5cb323d705 Mon Sep 17 00:00:00 2001
From: Dmitry Jemerov <yole@jetbrains.com>
Date: Thu, 19 Feb 2015 18:59:00 +0100
Subject: remove dependency of Location on a File; use more meaningful
 locations in tests

---
 test/src/TestAPI.kt | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'test/src')

diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt
index 95fe655e..d47770f8 100644
--- a/test/src/TestAPI.kt
+++ b/test/src/TestAPI.kt
@@ -99,8 +99,12 @@ fun ContentNode.toTestString(): String {
     }.toString()
 }
 
-val tempLocation = Location(File("/tmp/out"))
+class InMemoryLocation(override val path: String): Location {
+    override fun relativePathTo(other: Location, extension: String): String = other.path
+}
 
 object InMemoryLocationService: LocationService {
-    override fun location(node: DocumentationNode) = tempLocation;
+    override fun location(node: DocumentationNode) = InMemoryLocation(relativePathToNode(node));
 }
+
+val tempLocation = InMemoryLocation("")
-- 
cgit