Entries Tagged as 'Ruby / Rails'

Thursday, January 10th, 2008

Rails sucks?

With astonishing regularity, articles or posts come out claiming that Rails sucks in some way or another. People complain that Rails isn’t as easy to deploy as PHP, that Rails just didn’t do it for project XYZ. They range from the articulate and well thought out to the frankly inane and stupid (and wrong). Recently, […]

Monday, November 26th, 2007

Array matcher

Here’s a lovely little snippet that shows the reasons why Ruby is such a nice language to work with. It’s to do with matching at least one of a series of items in RSpec.

[?]

Share

reddit_url = ‘http://www.inter-sections.net/2007/11/26/array-matcher/’;

Thursday, October 25th, 2007

Principles of Rails Development

I am trying to put together a series of articles on “correct” Rails development, for the purpose of helping to get across what I mean to a company that I am working with. I thought I’d post them on my blog because they can be useful for others too.
I see these applying to any size […]

Sunday, October 21st, 2007

Integration testing with rfacebook - solving the session problem

It’s always very important to write integration tests. Hell, it’s not just very important, it’s critical. Some systems make it easier than others to do so. Rails, for instance, provides many, many hooks and bits of framework to make your apps easily testable. Facebook, on the other hand, is a major pain in the ass.
One […]

Saturday, October 20th, 2007

Spying on an object’s method calls

Sometimes, while figuring out why something doesn’t work, it’s useful to just quickly get a dump of what methods are being called, e.g. on a controller. Yes, debuggers can help you do that, but you don’t always want the full power of a debugger. Sometimes you just want to spy what’s happening in there.

[?]

Share

reddit_url […]

Friday, October 19th, 2007

What to test and specify, and where to do it

So I’ve been struggling a bit with my specifications approach lately. Well, only until I found out about the new Story Runner functionality in rspec. That’s resolved a number of things, by providing a powerful tool to prepare integration tests (in the form of User Stories). From the look of things, it seems like many […]

Thursday, October 4th, 2007

Specifying a before_filter and/or private method

How do you write specs for a private or protected method? Specifically (as this is often the case), how do you write a spec for a before_filter?
The answers that I found while looking online were not very explicit. The main points seemed to be “don’t test private/protected method”, “you should be specifying expected behaviours in […]

Wednesday, October 3rd, 2007

The difference between TDD and BDD

“It’s all about the words”. “Focus on behaviour”. “Design your API as a client of your own API”. “It’s a clearer way to express the same thing, so it helps communication with stakeholders”. Those are all typical responses to the questions “Why is Behaviour Driven Development better than Test Driven Development? Why should I switch […]

Saturday, September 29th, 2007

Textmate rSpec error

Just a short post to mention an issue with TextMate and the rSpec bundle that wasn’t so easy to figure out. There’s not much help on google about this, but I got lucky, so I thought I’d share it here so that if others encounter the same issue.
Sometimes, you might press your rSpec run shortcut, […]

Wednesday, September 26th, 2007

Polymorphic has_many :through enhanced

Yesterday I posted an article describing how to do a DRY, readable polymorphic has_many :through join. Since then, I’ve made a few key improvements to them, so I thought I’d share them here.

[?]

Share

reddit_url = ‘http://www.inter-sections.net/2007/09/26/polymorphic-has_many-through-enhanced/’;

Tuesday, September 25th, 2007

Polymorphic, has_many :through join model

Here’s the problem I was trying to solve today. I’ve got a data model that includes users and messages. Each user can have many messages. Each user can have many friends. Generally, a user will want to display all of his friends’ and his own messages together on a single “board” of sorts. So far […]

Close
E-mail It