dnaumov/midje-mode — Issue #9: 'lein midje' works, but 'C-c ,' doesn't
Author: gw666
Created: 2012-01-15 05:54:01+00:00
State: open

I hope somebody can explain this behavior--I've spent a lot of hours trying to understand what's wrong. Here's my sole test:

(against-background

[(before :contents
(doall
(db/SYSsetup-InfWb "brain" "test")
(db/SYSload "four-notecards")))

(around :checks ;was :facts
(let [IGNORE (db/SYSclear-all) ; new test; clear local data
test-icard (nth (db/get-all-icards) 0)
test-sldata (db/new-sldata test-icard)
test-slip (nth (db/get-all-slips) 0)

frame1 (PFrame.)
canvas1 (.getCanvas frame1)
layer1 (.getLayer canvas1)
dragger (PDragEventHandler.)
IGNORE (.setMoveToFrontOnPress dragger true)
IGNORE (.setPanEventHandler canvas1 nil)
IGNORE (.addInputEventListener canvas1 dragger)
IGNORE (println
"Check the topmost window; it should show"
"one slip")
]
?form ))

(after :contents
(doall
(Thread/sleep 8000)
(db/SYSdrop "four-notecards")))
]

(fact
; FCNS TESTED: show
(db/show test-slip 50 150 layer1) => nil)

) ; close "against-background"

What's odd is this: running `lein midje` works:

22:23 (work2) infwb $lein midje infwb.test.system-basics
Check the topmost window; it should show one slip
All claimed facts (1) have been confirmed.
22:38 (work2) infwb $

...but in Emacs, executing `C-c ,` with the cursor inside the fact returns the following error in a new frame:

Unable to resolve symbol: test-slip in this context
[Thrown class java.lang.Exception]

The value of test-slip must be visible to the fact for `lein midje` to pass it, so why doesn't the `C-c ,` command succeed?

Many thanks for your ideas and help!