[rspec-users] autogenerated it (was 'Custom Matcher and NAME NOT GENERATED annoyance')

David Chelimsky dchelimsky at gmail.com
Fri May 4 22:57:45 EDT 2007


> On 5/5/07, Luis Lavena <luislavena at gmail.com> wrote:
> > describe "A User (in general)" do
> >   before(:each) do
> >     @user = User.new
> >   end
> >
> >   it { @user.should have_many(:contest_public_votes) }
> >   it { @user.should have_many(:design_industry_user_interests) }
> >   it { @user.should have_one(:user_extension) }
> > end
> >

When I've used the autogenerated names, I've used specify:

specify { @user.should have_many(:contest_public_votes) }
specify { @user.should have_many(:design_industry_user_interests) }
specify { @user.should have_one(:user_extension) }

That reads better than 'it' in my view, but I'm not happy w/ 'specify'
either. What other words would make sense in this situation? One thing
that occurs to me in this particular example is 'the':

describe User do
the { @user.should have_many(:contest_public_votes) }
the { @user.should have_many(:design_industry_user_interests) }
the { @user.should have_one(:user_extension) }

But I don't know if that would work that often.

Other ideas?

David


More information about the rspec-users mailing list