plumatic / dommy

A tiny ClojureScript DOM manipulation and event library
759 stars 74 forks source link

New value & set-value! core functions #30

Closed rm-hull closed 11 years ago

rm-hull commented 11 years ago

value & set-value are primarily used to get/set the values of form elements such as input, select and textarea; they act much the same way as other core functions: text / set-text! / html / set-html!

Also clarified readme docs on how to run tests.

All the test pass according to the generated html/js, but I see the following on the command line:

$ lein cljsbuild test
Compiling ClojureScript.
Compiling "target/main.js" from ["src"]...
Successfully compiled "target/main.js" in 13.820142752 seconds.
Compiling "target/unit-test.js" from ["src" "test"]...
Successfully compiled "target/unit-test.js" in 9.419794231 seconds.
Running all ClojureScript tests.
PElement: js/Window not defined by browser, skipping it... (running on phantomjs?)
2 tests failed
Exception in thread "main" java.lang.Exception: Test failed.
    at cljsbuild.test$run_tests.invoke(test.clj:12)
    at user$eval199.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:6511)
    at clojure.lang.Compiler.eval(Compiler.java:6501)
    at clojure.lang.Compiler.eval(Compiler.java:6477)
    at clojure.core$eval.invoke(core.clj:2797)
    at clojure.main$eval_opt.invoke(main.clj:297)
    at clojure.main$initialize.invoke(main.clj:316)
    at clojure.main$null_opt.invoke(main.clj:349)
    at clojure.main$main.doInvoke(main.clj:427)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:419)
    at clojure.lang.AFn.applyToHelper(AFn.java:163)
    at clojure.lang.Var.applyTo(Var.java:532)
    at clojure.main.main(main.java:37)
Subprocess failed

Ubuntu 13.04 64-bit, Lein 2.1.3, Jdk 1.7.0_21

cpetzold commented 11 years ago

Your value and set-value! look fine, but the readme change is a bit misleading. You only need phantomjs if you want to run lein cljsbuild test. Alternatively, you can run lein cljsbuild auto test to compile, and load resources/dommy-tests.html in a browser. If you fix the readme bit I'll gladly merge.