anchor.diff:  
   == [[testing]] testing
   
  -See the link:/test/clojure/tests[tests] for lots of examples of how to use
  +See the code in link:/test/clojure/tests[tests] for lots of examples of how to use
   the library.  Be **be forewarned**, the test cases are in flux; some
   of them are outdated, and the api is changing.
   
  -There are lots of ways to set up a dev/test environement.  Here's how
  -I've been testing using the repl.  I use `dev/user.clj` to
  -initialize/configure my repl.
  -
  +The testing env:
  +
  +==== unit testing:
  +
  +Run the `testing` task before the `test` task; it puts test/clj on the
  +class path, which exposes the GAE dev services. Use -n to specify the
  +namespace to test (omit to run all tests):
  +
  +[[app-listing]]
  +[source,clojure]
  +----
  +$ boot testing test -n test.local-ctor
  +
  +----
  +
  +==== testing at the repl
   dev/user.clj:
   ----
  +
   (require '[clojure.test :refer [run-tests test-var]])  ;; :all
   (require '[clojure.tools.namespace.repl :refer [refresh refresh-all]])
   ----
  
positive.code: == [[start]]getting started
  
  **NOTE:** you do not need an App Engine account to explore this
    library in a development environment.  The gradle build system will
    download and install (to `~/.gradle`) everything you need.
  
  1.  Fork/clone
  2.  $ lein with-profile compile compile
  3.  $ lein repl
  
  **WARNING**  Tested only on Mac OS X 10.9.5
  
  
negative.code: experimentation.  So from the root directory, fire up a repl and start
  experimenting:
  
  NOTE: use boot -C if your terminal colors are hard to read
  
  [[app-listing]]
  [source,clojure]
  ----
  $ boot testing repl
  ;; the testing task puts test/clj on the class path, which exposes the GAE dev services
  nREPL server started on port 57767 on host 127.0.0.1 - nrepl://127.0.0.1:57767
  ...etc...
  boot.user=> (require '[migae.datastore :as em] :reload-all)
  boot.user=> (require '[test.rig :as ds] :reload)
  boot.user=> (ds/setup)   ;; initialize GAE datastore service emulation
  ;; if try to use the ds without running ds/setup, you'll get:
  ;; java.lang.NullPointerException: No API environment is registered for this thread.
  boot.user=> (def em1 (em/entity-map! [:A/B] {:a 1}))
  boot.user=> em1
  {:a 1}
  boot.user=> (em/entity-map? em1)
  true
  boot.user=> (type em1)
  migae.datastore.PersistentEntityMap
  boot.user=> (:migae/keychain em1)
  [:A/B]
  boot.user=> (:a em1)
  1
  boot.user=> (meta em1)
  #:migae{:keychain [:A/B]}
  boot.user=> (.content em1)
  #object[com.google.appengine.api.datastore.Entity 0x5bb99523 "<Entity [A(\"B\")]:\n\ta = 1\n>\n"]
  ;; use println to get a formatted representation
  boot.user=> (em/keychain? (em/keychain em1))
  true
  
  ;; pull constructor fetches Entity from datastore
  boot.user=> (em/entity-map* [:A/B])
  {:a 1}
  
  ;; refresh test datastore
  boot.user=> (ds/teardown)
  boot.user=> (ds/setup)
  
  ;; run some tests from the repl
  boot.user=> (require 'test.ctor_push)
  
  ...etc...
  
  user=> (key em)
  [:A/B]
  user=> (val em)
  {:a 1}
  
  == [[types]]types
  
  