Skip to content

Commit b5b30da

Browse files
committed
Fix tests
1 parent 298255a commit b5b30da

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/eca/features/rules_test.clj

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
fs/absolute? (constantly true)
2424
fs/exists? (constantly true)
2525
fs/canonicalize identity
26-
fs/file-name (fn [p] (last (string/split p #"/")))]
27-
(let [config {:rules [{:path "/path/to/my-rule.md"}]}]
26+
fs/file-name (constantly "cool-name")]
27+
(let [config {:rules [{:path (h/file-path "/path/to/my-rule.md")}]}]
2828
(is (match?
2929
(m/embeds [{:type :user-config
30-
:path "/path/to/my-rule.md"
31-
:name "my-rule.md"
30+
:path (h/file-path "/path/to/my-rule.md")
31+
:name "cool-name"
3232
:content "MY_RULE_CONTENT"}])
3333
(f.rules/all config [] vars))))))
3434

@@ -37,27 +37,27 @@
3737
fs/exists? (constantly true)
3838
fs/list-dir (constantly [])
3939
fs/canonicalize identity
40-
fs/file-name (fn [p] (last (string/split (str p) (re-pattern fs/file-separator))))
40+
fs/file-name (constantly "cool-name")
4141
clojure.core/slurp (constantly "MY_RULE_CONTENT")]
4242
(let [config {:rules [{:path ".foo/cool-rule.md"}]}
4343
roots [{:uri (h/file-uri "file:///my/project")}]]
4444
(is (match?
45-
(m/embeds [{:type :user-config
46-
:path (h/file-path "/my/project/.foo/cool-rule.md")
47-
:name "cool-rule.md"
48-
:content "MY_RULE_CONTENT"}])
49-
(f.rules/all config roots vars))))))
45+
(m/embeds [{:type :user-config
46+
:path (h/file-path "/my/project/.foo/cool-rule.md")
47+
:name "cool-name"
48+
:content "MY_RULE_CONTENT"}])
49+
(f.rules/all config roots vars))))))
5050

5151
(testing "file rules"
5252
(with-redefs [fs/exists? (constantly true)
53-
fs/list-dir (constantly [(fs/path "cool-rule.md")])
53+
fs/list-dir (constantly [(fs/path "cool.md")])
5454
fs/canonicalize identity
55-
fs/file-name (fn [p] (last (string/split (str p) #"/")))
55+
fs/file-name (constantly "cool-name")
5656
clojure.core/slurp (constantly "MY_RULE_CONTENT")]
5757
(let [roots [{:uri (h/file-uri "file:///my/project")}]]
5858
(is (match?
5959
(m/embeds [{:type :user-file
60-
:path "cool-rule.md"
61-
:name "cool-rule.md"
60+
:path "cool.md"
61+
:name "cool-name"
6262
:content "MY_RULE_CONTENT"}])
6363
(f.rules/all {} roots vars))))))))

0 commit comments

Comments
 (0)