diff --git a/fnl/conjure-spec/client_spec.fnl b/fnl/conjure-spec/client_spec.fnl index 0a38a0b5..02b382cc 100644 --- a/fnl/conjure-spec/client_spec.fnl +++ b/fnl/conjure-spec/client_spec.fnl @@ -50,18 +50,17 @@ (client.set-state-key! :default) (assert.equal 1 (state :foo :bar))))))) -; (describe "current-client-module-name" -; (fn [] -; (describe "with-filetype" -; (fn [] -; (it "returns the fennel module when we're in a fennel file" -; (fn [] -; ;; Error in error handling? -; (assert.same -; {:extension "fnl" -; :filetype "fennel" -; :module-name "conjure.client.fennel.aniseed"} -; (client.with-filetype "fennel" #(client.current-client-module-name))))))))) +(describe "current-client-module-name" + (fn [] + (describe "with-filetype" + (fn [] + (it "returns the fennel module when we're in a fennel file" + (fn [] + (assert.same + {:filetype "fennel" + :module-name "conjure.client.fennel.aniseed"} + (client.with-filetype "fennel" #(client.current-client-module-name))) + nil)))))) ; (describe "with-filetype" ; (fn [] diff --git a/lua/conjure-spec/client_spec.lua b/lua/conjure-spec/client_spec.lua index bbd25ac4..7417508a 100644 --- a/lua/conjure-spec/client_spec.lua +++ b/lua/conjure-spec/client_spec.lua @@ -52,4 +52,18 @@ local function _10_() end return it("returns a function we can use to look up the current state-key's data for this specific state, the function encloses it's own table of state indexed by state-key", _11_) end -return describe("new-state", _10_) +describe("new-state", _10_) +local function _13_() + local function _14_() + local function _15_() + local function _16_() + return client["current-client-module-name"]() + end + assert.same({filetype = "fennel", ["module-name"] = "conjure.client.fennel.aniseed"}, client["with-filetype"]("fennel", _16_)) + return nil + end + return it("returns the fennel module when we're in a fennel file", _15_) + end + return describe("with-filetype", _14_) +end +return describe("current-client-module-name", _13_)