June 23, 2008 at 7:16 pm
· Filed under development, rails, testing
I neglected to read the ruby / rails unit test documentation because it seemed cumbersome at first glance. I rolled my own thing for models and assumed controllers would do what they were supposed to do. That worked well enough to get me up and going but tonight I decided I needed something more reliable and rather than reinvent the wheel…..
So I did some reading. The unit tests aren’t as decoupled as I would like them to be (yes Michael Feathers, you have made an impact in my life (his legacy code book is pretty good. I suggest it). I firmly believe that a unit test should not use a database or network. I think you can do that with the model well enough (by avoiding fixtures), but it looks next to impossible for controllers. From what I’ve read testing a controller makes http requests to the web server. I’m not a purist or anything, but its a bummer it has to do that. And I don’t think I can setup an in memory model object for a controller to work with (I’m probably wrong about that, I’d guess there’s some magic) I’d imagine for a full tests suite it would slow things down considerably. The other thing I’m not immediately seeing is a way to sense through a fixture. While not strictly necessary (and may in fact be more trouble than its worth) it sounds like a neat idea. All that said, it looks like the functional testing you can do with the unit test framework is pretty slick. I’m kicking around the idea of setting up some sort of nightly check out / test run just for kicks.
There has been a vanilla crisis in my house ( I think I get cookies!) I’m out.
Permalink
June 17, 2008 at 7:45 pm
· Filed under brewing, development, rails
Tonight users got inventory’s. I’m not sure why I started working on this. I added it in the account controller the other for some reason. That struck me as ugly so I moved the creation of the inventory down into the user model. I also learned what magic (err not so much magic as you know… passing a parameter) I needed to overload ActiveRecords constructor. Seems harder than it should have been, but I probably wasn’t looking in the right place (google didn’t turn up anything too revealing, should have put Buck on it, mad google skills that one.). If anyone is ever looking for it you want to do:
def initialize(params = {}) #Not def initialize()
super(params)
....
end
So anyway, users now compose inventories. Life is good for them. Still can’t enter recipies, because you know I got side tracked. But eh that’s how it goes.
I’ve got beer to rack & bottle (heff into bottles and racking a brown to secondaries) tomorrow night so I won’t get to work on the site for a day or two. When I get back to it I’ll finish up the recipe stuff and get it out there.
Permalink
June 11, 2008 at 7:02 pm
· Filed under brewing, development, me, rails
This will be the development blog for Brew Manager. Eventually it will do all the stuff it says it does on the front page. For now I’ve gotten hosting setup and the domain name registered. I’m pretty sure I got a rails app created on godaddy.com. We will see how that works out as the internets don’t have great things to say about people success rate.
Like I said above, its going to be a rails site. I started playing with Ruby about a year ago. I took a rails seminar at school (I’m working on my masters) and thought “eh, what the heck”. It will run of mysql and whatever webserver godaddy puts in front of it. If someone other than me ever uses this… well we will cross that bridge when we come to it.
I’ve been home brewing for about a year now and this seemed like a good idea. There are a lot of tools out there that do some, and possibly all of what I’m anticipating putting on Brew Sessions. I’m not saying those tools are bad (I use a few of em), but for the most part they don’t meet my needs. This is aimed primarily at making me happy, but if you have a feature request feel free to drop me a line (josh at brewmanager.com) and I’ll consider it.
Here’s the feature list in case I get rid of it.
- Inventory Managment
- Brew Session Managment (it does the math for mash calculations, AAU etc
- Recipe Managment (build, save and search)
- Groups/clubs, with all of the above
Permalink