|
210 | 210 | (before-each
|
211 | 211 | ;; FIXME: Needed because its set in an earlier test
|
212 | 212 | (setq-local cider-jack-in-lein-plugins nil)
|
| 213 | + (setq-local cider-jack-in-dependencies nil) |
213 | 214 | (setq-local cider-jack-in-nrepl-middlewares '("cider.nrepl/cider-middleware"))
|
214 | 215 | (setq-local cider-jack-in-dependencies-exclusions '()))
|
215 | 216 | (it "can concat in a lein project"
|
|
292 | 293 | (expect (cider-inject-jack-in-dependencies "" "repl :headless" 'lein)
|
293 | 294 | :to-equal (concat "update-in :dependencies conj "
|
294 | 295 | (shell-quote-argument "[nrepl/nrepl \"0.9.0\"]")
|
| 296 | + " -- update-in :dependencies conj " |
| 297 | + (shell-quote-argument "[refactor-nrepl \"2.0.0\"]") |
295 | 298 | " -- update-in :plugins conj "
|
296 | 299 | (shell-quote-argument "[refactor-nrepl \"2.0.0\"]")
|
297 | 300 | " -- update-in :plugins conj "
|
|
397 | 400 | "YwBsAG8AagB1AHIAZQAgACIAIgBjAG0AZAAtAHAAYQByAGEAbQBzACIAIgA="))))
|
398 | 401 | (describe "when 'clojure-cli project type"
|
399 | 402 | (it "uses main opts in an alias to prevent other mains from winning"
|
| 403 | + (setq-local cider-jack-in-dependencies nil) |
400 | 404 | (setq-local cider-jack-in-nrepl-middlewares '("cider.nrepl/cider-middleware"))
|
401 | 405 | (let ((expected (string-join '("clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} "
|
402 |
| - "cider/cider-nrepl {:mvn/version \"0.28.3\"}} " |
| 406 | + "cider/cider-nrepl {:mvn/version \"0.28.3\"} " |
403 | 407 | ":aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\""
|
404 | 408 | " \"[cider.nrepl/cider-middleware]\"]}}}' -M:cider/nrepl")
|
405 | 409 | "")))
|
|
411 | 415 | (spy-on 'cider-jack-in-resolve-command :and-return-value "clojure")
|
412 | 416 | (expect (plist-get (cider--update-jack-in-cmd nil) :jack-in-cmd)
|
413 | 417 | :to-equal expected)))
|
| 418 | + |
414 | 419 | (it "allows specifying custom aliases with `cider-clojure-cli-aliases`"
|
415 | 420 | (let ((expected (string-join '("clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} "
|
416 |
| - "cider/cider-nrepl {:mvn/version \"0.28.3\"}} " |
| 421 | + "cider/cider-nrepl {:mvn/version \"0.28.3\"} " |
417 | 422 | ":aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\""
|
418 | 423 | " \"[cider.nrepl/cider-middleware]\"]}}}' -M:dev:test:cider/nrepl")
|
419 | 424 | "")))
|
| 425 | + (setq-local cider-jack-in-dependencies nil) |
420 | 426 | (setq-local cider-clojure-cli-aliases "-A:dev:test")
|
421 | 427 | (setq-local cider-allow-jack-in-without-project t)
|
422 | 428 | (setq-local cider-clojure-cli-command "clojure")
|
|
426 | 432 | (expect (plist-get (cider--update-jack-in-cmd nil) :jack-in-cmd)
|
427 | 433 | :to-equal expected)))
|
428 | 434 | (it "should remove duplicates, yielding the same result"
|
429 |
| - (let ((expected (string-join '("-Sdeps '{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} " |
430 |
| - "cider/cider-nrepl {:mvn/version \"0.28.3\"}} " |
| 435 | + (let ((expected (string-join '("-Sdeps '{:deps {cider/cider-nrepl {:mvn/version \"0.28.3\"} " |
| 436 | + "nrepl/nrepl {:mvn/version \"0.9.0\"}} " |
431 | 437 | ":aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\""
|
432 |
| - " \"[cider.nrepl/cider-middleware]\"]}}}' -M:cider/nrepl") |
| 438 | + " \"[cider.nrepl/cider-middleware]\"]}}}' -M:dev:test:cider/nrepl") |
433 | 439 | "")))
|
434 | 440 | (expect (cider-clojure-cli-jack-in-dependencies nil nil '(("nrepl/nrepl" "0.9.0")
|
435 | 441 | ("nrepl/nrepl" "0.9.0")))
|
436 | 442 | :to-equal expected)))
|
437 | 443 | (it "handles aliases correctly"
|
438 |
| - (let ((expected (string-join '("-Sdeps '{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} " |
439 |
| - "cider/cider-nrepl {:mvn/version \"0.28.3\"}} " |
| 444 | + (let ((expected (string-join '("-Sdeps '{:deps {cider/cider-nrepl {:mvn/version \"0.28.3\"} " |
| 445 | + "nrepl/nrepl {:mvn/version \"0.9.0\"}} " |
440 | 446 | ":aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\""
|
441 | 447 | " \"[cider.nrepl/cider-middleware]\"]}}}' -M:test:cider/nrepl")
|
442 | 448 | ""))
|
|
458 | 464 | (expect (cider-clojure-cli-jack-in-dependencies nil nil deps)
|
459 | 465 | :to-equal expected)))))
|
460 | 466 | (it "allows for global options"
|
461 |
| - (let ((expected (string-join '("-J-Djdk.attach.allowAttachSelf -Sdeps '{:deps {nrepl/nrepl {:mvn/version \"0.9.0\"} " |
462 |
| - "cider/cider-nrepl {:mvn/version \"0.28.3\"}} " |
| 467 | + (let ((expected (string-join '("-J-Djdk.attach.allowAttachSelf -Sdeps '{:deps {cider/cider-nrepl {:mvn/version \"0.28.3\"} " |
| 468 | + "nrepl/nrepl {:mvn/version \"0.9.0\"}} " |
463 | 469 | ":aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\""
|
464 | 470 | " \"[cider.nrepl/cider-middleware]\"]}}}' -M:test:cider/nrepl")
|
465 | 471 | ""))
|
|
0 commit comments