     [limelight.prop :only (new-prop)]
     [limelight.production :only (new-production)]
     [limelight.test-help :only (fake-fs *fs*)]
-    [lazytest.describe :only (describe testing it with given)]
+    [lazytest.describe :only (describe testing it with given do-it)]
     [lazytest.context :only (fn-context)])
   (:import [limelight.casting-director CastingDirector]))
 
-(defn setup-prop [options]
+(defn setup-scene []
   (let [production (new-production (limelight.model.FakeProduction. "MockProduction"))
         scene (new-scene {:path "root"})
         _ (.setCastingDirector @(.peer scene) (limelight.model.api.FakeCastingDirector.))
-        _ (.setProduction @(.peer scene) (.peer production))
+        _ (.setProduction @(.peer scene) (.peer production))]
+    scene))
+
+
+(defn setup-prop []
+  (let [scene (setup-scene)
         [prop] (add-props scene (new-prop {}))]
     [prop scene]))
 


  (testing "includes one player from scene"
    (given [fs (setup-fs {"/root/players/test_player.clj" "(on-mouse-clicked (fn [_]))"})
            [prop scene] (setup-prop {})
            casting-director (new-casting-director scene)
            _ (.castPlayer casting-director prop "test-player")]
      (it (= 1 (-> prop
        (.peer)
        (deref)
        (.getEventHandler)
        (.getActions limelight.ui.events.panel.MouseClickedEvent)
        (count))))))

  (testing "includes one player from production"
    (given [fs (setup-fs {"/MockProduction/players/test_player.clj" "(on-mouse-clicked (fn [_]))"})
            [prop scene] (setup-prop {})
            casting-director (new-casting-director scene)
            _ (.castPlayer casting-director prop "test-player")]
      (it (= 1 (-> prop
        (.peer)
        (deref)
        (.getEventHandler)
        (.getActions limelight.ui.events.panel.MouseClickedEvent)
        (count))))))
  )

    (doall (map (fn [[filename content]] (.createTextFile fs filename content)) options))
    fs))

(defn actions-for [prop event]
  (-> prop
    (.peer)
    (deref)
    (.getEventHandler)
    (.getActions event)))

(describe "CastingDirector"

  (testing "creation"
    (given [scene (new-scene {})
            casting-director (new-casting-director scene)]
      (it "has en empty cast" (= {} @(.cast casting-director)))))

