[rspec-users] RSpec makes me want to write better code

Mark Wilden mark at mwilden.com
Fri Sep 26 13:27:56 EDT 2008

On Fri, Sep 26, 2008 at 10:24 AM, Scott Taylor <
mailing_lists at railsnewbie.com> wrote:

> I usually end up doing something like this:
>   columns = [:email, :message]
>   columns.each do |column|
>     it "should have a reader and writer for the column #{column}" do
>       @invite.should respond_to(column)
>       @invite.should respond_to("#{column}=")
>     end
>   end

That looks like a really good way to do this - thanks! Beyond that, as they
say, you're testing ActiveRecord.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080926/a79411cf/attachment.html>

More information about the rspec-users mailing list