Skip to content

Instantly share code, notes, and snippets.

@jvillste
Created February 26, 2012 12:53
Show Gist options
  • Save jvillste/1916569 to your computer and use it in GitHub Desktop.
Save jvillste/1916569 to your computer and use it in GitHub Desktop.
protocol mocking
;.;. FAIL at (NO_SOURCE_FILE:1)
;.;. Expected: [{:y 20, :x 10, :height 10} {:y 30, :x 10, :height 15} {:y 45, :x 10, :height 10}]
;.;. Actual: java.lang.ClassCastException: clojure_lwjgl.applications.traditional$eval6058$fn__6059$fn$reify__6061 cannot be cast to clojure.lang.Associative
;.;. clojure_lwjgl.applications.traditional$vertical_stack.invoke(traditional.clj:50)
;.;. clojure_lwjgl.applications.traditional$eval6058$fn__6059$fn__6060.invoke(NO_SOURCE_FILE:1)
;.;. clojure_lwjgl.applications.traditional$eval6058$fn__6059.invoke(NO_SOURCE_FILE:1)
;.;. clojure_lwjgl.applications.traditional$eval6058.invoke(NO_SOURCE_FILE:1)
;.;. clojure_lwjgl.applications.traditional$eval6054.invoke(NO_SOURCE_FILE)
(fact "vertical stack sets x and y coordinates"
(vertical-stack 10
20
[(reify layoutable/Layoutable (layoutable/preferred-height [_] 10))
(reify layoutable/Layoutable (layoutable/preferred-height [_] 15))
(reify layoutable/Layoutable (layoutable/preferred-height [_] 10))])
=> [{:height 10, :x 10, :y 20}
{:height 15, :x 10, :y 30}
{:height 10, :x 10, :y 45}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment