A post about testing and then something about leiningen

I am writing this post in emacs tonight instead of the WordPress editor. I don’t know if it will make much difference, but I’ll keep it in markdown-mode for tonight.
I posted some questions about functional testing in rails. I am currently building what is most likely my most complicated rails application to date. I’ve been getting better at rails, but some of the things are still taking time to set in.
I’ve decided to really push the TDD aspect on this particular app. I am exploring using authlogic and declarative authorization to handle the security controls of the app. This is the kind of thing you want you want to be testing like crazy.
I’ve been having trouble with testing using loops to test access. One of the libraries uses a protected value that is only being set when a page is requested. I managed to log a user in, and that’s working quite well, but I’m having trouble logging that user out and a new user in within the same test case. I had this nice, elegant loop crafted that would allow me to establish a data structure that would allow me to control every aspect of the test. Alas, it would fail when it came time to change users. I put tons of debug code everywhere. I was hitting C-c ‘ r t <tab> <return> like crazy. I cleared everything that could even look like a bit of session. I couldn’t get Authorization.current_user to reflect the credentials of the current UserSession.
I do feel that I made up for it quite nicely. I managed to take about 3-4 lines of every test and pack it all into a single function that lets me specify the rules of the access check using a map. I’m quite happy with it
In clojure news. I’ve finally taken the plunge and have learned Leiningen. I was previously using Maven, so I’m not that hard of a sell. I like some of the ideas, but truthfully, I’m more interested in the polyglot maven project. I think it would be interesting if one or both of the projects could make it so they could try to read the other’s build files if available. So my first task was to take the clj-mql library, which I had just
checked out because I’m trying to learn more MQL, and convert the dependencies to maven. I hit a snag on something, and when I asked
about it in IRC, someone asked why I wasn’t just using lein.
So I threw out my pom.xml and made a project.clj for it.
Leiningen currently has a problem with it’s swank option which is causing src/ to not be on the path. You can always use the repl option
or the distasteful add-classpath option, but that will need to be fixed. Someone posted a horribly convoluted series of steps that I
attempted, but didn’t work for me.

On Writing. (a second blog post in the night)

Wow! The response has been impressive. I just posted a blog post, the first I’ve done in quite some time, and already that post is on the front page of duck1123.wordpress.com. I can’t believe. I can’t stand it. How dare that post take of the most coveted first post on that site that just so happens to be the one that takes it’s name from the online id I use. I must knock it down by publishing that one.

First I must sprinkle you with fairy dust and while you’re distracted, I go and grab a cigarette from my wife.

Ha Ha! She may only have two, but I have many. Not only that, but I found some Cherry Coke and the keyboard for my macbook.

I try to like the macbook. I will give it credit, it is not that bad, but for the past several years I have been pretty much exclusively an Ubuntu user. I like Ubuntu and I pretty much have it set up pretty well. I’ve run dual boot off and on, but recently it’s been I only rebooted on the weekends if I wanted to play sims or Toby wanted to play Portal and then I would immediately reboot back into linux because ironically I haven’t been able to get Windows 7 to share it’s NTFS drive with the mac using the windows share protocol. I have to log into linux to get that.

I’ve been becoming a big fan of XBMC lately. We don’t have a TV in our bedroom and I bring the macbook into the bedroom and hook it up to an old CRT monitor that we had extra and the iPod docking clock radio my dad bought me for christmas one year because he thought I had an iPod. I didn’t. I had a Creative Zen M:Video which I now can’t use anymore because Toby jammed the cord into it and bent the pins.

Anyway, XBMC (You know. I really wish the technology was (Pandora just asked me if I was still listening (my wife just messaged (can you tell I’m a lisp programmer) from the other room. ) I said yes) there to nest thoughts better in blog posts) No time for that tonight. I should write that in another post

Follow

Get every new post delivered to your Inbox.