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

Luis Lavena luislavena at gmail.com
Fri May 4 23:03:27 EDT 2007


On 5/4/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> > 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,

'the' is a good term to describe it, but there aren't too many cases
(er, examples) that could use that alias of it.

I only see use for one expectation, auto-generated ones.

-- 
Luis Lavena
Multimedia systems
-
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi


More information about the rspec-users mailing list