From 3daa94893dc343efd58c6009af50ce69eb656ade Mon Sep 17 00:00:00 2001 From: Imre Koszo Date: Wed, 18 Nov 2015 11:49:05 +0000 Subject: [PATCH 1/3] Fixing dynamic var definition and upgrading clojure version --- project.clj | 2 +- src/cljgiven/core.clj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/project.clj b/project.clj index bc0807f..6e73641 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ (defproject clojure-given "1.1.0" :description "test framewor inspire by rspec-given " - :dependencies [[org.clojure/clojure "1.2.1"]] + :dependencies [[org.clojure/clojure "1.7.0"]] :dev-dependencies[[lein-eclipse "1.0.0"]]) diff --git a/src/cljgiven/core.clj b/src/cljgiven/core.clj index 3c46fbb..5852651 100644 --- a/src/cljgiven/core.clj +++ b/src/cljgiven/core.clj @@ -5,7 +5,7 @@ ;Map for looking up lazy accessor varables ;Each test and creats a local binding for this -(def *clj-given* (atom {:global :holder})) +(def ^:dynamic *clj-given* (atom {:global :holder})) ;####################################################### ; Primary Macros Given,Given!,When, Then From a7f8af64b019745b61e5af476dad8755209bac47 Mon Sep 17 00:00:00 2001 From: Imre Koszo Date: Wed, 18 Nov 2015 12:03:28 +0000 Subject: [PATCH 2/3] Adding more forward declarations --- src/cljgiven/core.clj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cljgiven/core.clj b/src/cljgiven/core.clj index 5852651..c946e52 100644 --- a/src/cljgiven/core.clj +++ b/src/cljgiven/core.clj @@ -2,6 +2,8 @@ (declare get-syms) (declare suround-let) (declare set-re-exec) +(declare set-given-var) +(declare set-given-var!) ;Map for looking up lazy accessor varables ;Each test and creats a local binding for this From f4c4643d8e491b7f571e6d6aaa72e78d46e48c28 Mon Sep 17 00:00:00 2001 From: Imre Koszo Date: Wed, 18 Nov 2015 12:11:29 +0000 Subject: [PATCH 3/3] fully specifying some symbol names --- src/cljgiven/core.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cljgiven/core.clj b/src/cljgiven/core.clj index c946e52..396db9d 100644 --- a/src/cljgiven/core.clj +++ b/src/cljgiven/core.clj @@ -19,12 +19,12 @@ (defmacro Given [vect] "Creates a lazy accessor for variables" - (seq (reduce #(conj %1 (conj %2 'set-given-var)) ['do] + (seq (reduce #(conj %1 (conj %2 'cljgiven.core/set-given-var)) ['do] (partition 2 vect)))) (defmacro Given! [vect] "Similar to Given but does not provide lazy eval" - (seq (reduce #(conj %1 (conj %2 'set-given-var!)) ['do] + (seq (reduce #(conj %1 (conj %2 'cljgiven.core/set-given-var!)) ['do] (partition 2 vect)))) (defmacro When [sym & body] @@ -35,7 +35,7 @@ (defmacro Then [body] "alias for the clojure.test macro 'is' that also allows for access to Given, Given! and When vars" - `(eval (suround-let (quote (clojure.test/is ~body))))) + `(eval (suround-let (quote (clojure.test/is ~body))))) (defmacro Context [msg & body] "alias for clojure.text 'testing' also creats the