On Sun, Jan 15, 2012 at 6:18 PM, Matt Stump <mst...@sourceninja.com> wrote: > Is there a way to set different values for global vars when running tests as > opposed to the development or production environment? I need to control > which database my tests for a noir project connect to. Ideally I would like > to do something like the following: for production and development, if > an environment variable is set connect to the database server at the > specified URL, if not then fall back to localhost. For test start up an > embedded server, and connect. After the test is done, rollback the global > var to the previous value and resume connecting to the server on localhost > or at the location specified by the environment variable. > > I could create some fixture with-test-database that modifies a global var, > but that seems a little hackish. > > How are other people solving this problem? Is there something similar > pre-baked into noir, clojure.test or midje?
How about with-redefs? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en