-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: ensure CollieRepository always uses an absolute path
- Loading branch information
1 parent
7931411
commit ad4790a
Showing
5 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
import { assertEquals } from "std/testing/assert"; | ||
import { assertEquals, assertNotEquals } from "std/testing/assert"; | ||
import { CollieRepository } from "./CollieRepository.ts"; | ||
|
||
Deno.test("relativePath calculates paths relative to repository root", () => { | ||
const sut = new CollieRepository("/tmp/test"); | ||
const sut = CollieRepository.uninitialized("/tmp/test"); | ||
|
||
const result = sut.relativePath("/tmp/test/123"); | ||
assertEquals(result, "123"); | ||
}); | ||
|
||
Deno.test("relativePath does not work with paths that are already relative", () => { | ||
const sut = CollieRepository.uninitialized("/tmp/test"); | ||
|
||
const result = sut.relativePath("123"); | ||
assertNotEquals(result, "123"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters