Re: Compojure with large project

263 views
Skip to first unread message

Nick Bauman

unread,
Mar 24, 2013, 10:44:17 AM3/24/13
to comp...@googlegroups.com

Writing a test asserting what's coming out of a route is trivial because of the referential transparency of a route. If you want to test at a higher level you could use Peridot or use my noir.util.test2 which is kinda out of date at the moment since the whole lib-noir change.

On Mar 24, 2013 8:44 AM, "Lee Brooks" <leebr...@gmail.com> wrote:
Hi

Are there any tutorials or code samples showing how to use Compojure for a large project (that includes tests)?
All of the tutorials and code examples I have seen are for really small projects and do not show how to test them,
so it is really difficult for me to understand how I would use Compojure on a larger project.

--
You received this message because you are subscribed to the Google Groups "Compojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to compojure+...@googlegroups.com.
To post to this group, send email to comp...@googlegroups.com.
Visit this group at http://groups.google.com/group/compojure?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nelson Morris

unread,
Mar 24, 2013, 10:54:33 AM3/24/13
to comp...@googlegroups.com
I think clojars https://github.com/ato/clojars-web/ is the largest
opensource clojure site. While there is still plenty of things to
cleanup, it does have several tests at the feature/integration level.
Some use kerodon https://github.com/xeqi/kerodon and others start up a
jetty server and use the same library underneath lein to verify
dependencies can actually be downloaded.

I've also made a screencast showing how to get form based
authentication working using friend
https://www.clojurewebdevelopment.com/videos/friend-interactive-form.
While a small project just for the screencast, It was done in a test
driven manner using kerodon.

Sean Bowman

unread,
Mar 24, 2013, 1:17:10 PM3/24/13
to comp...@googlegroups.com
We have a fairly large app based on Compojure. We test the routes by launching a test server and running a series of tests written in Ruby using Cucumber, RSpec, and RestClient. This lets us test the routing in the same way clients and browsers will access it. I've always preferred this kind of high-level "integration" testing to anything embedded into the app itself. It avoids us taking shortcuts in our test code and really tests that we've got Compojure's routing right at the same time.

Something like peridot or kerodon might be ok, but when everything is running in the same JVM, I never trust that something magical isn't happening that doesn't reflect the real world.
Reply all
Reply to author
Forward
0 new messages