Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (18 sloc) 0.685 kB
(ns seesaw.test.bind
(:use [seesaw.bind])
(:use [lazytest.describe :only (describe it testing)]
[lazytest.expect :only (expect)]))
(describe bind-atom-to-range-model
(it "Updates an atom when the model changes"
(let [a (atom -1)
m (javax.swing.DefaultBoundedRangeModel. 50 0 2 100)]
(expect (= a (bind-atom-to-range-model a m)))
(expect (= 50 @a))
(.setValue m 51)
(expect (= 51 @a))))
(it "Updates the model when the atom changes"
(let [a (atom -1)
m (javax.swing.DefaultBoundedRangeModel. 50 0 2 100)]
(expect (= a (bind-atom-to-range-model a m)))
(reset! a 99)
(expect (= 99 (.getValue m))))))
Jump to Line
Something went wrong with that request. Please try again.