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

David Chelimsky dchelimsky at gmail.com
Fri May 4 23:26:38 EDT 2007


On 5/4/07, Luis Lavena <luislavena at gmail.com> wrote:
> On 5/5/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> [...]
> > > I only see use for one expectation, auto-generated ones.
> >
> > That's what I'm talking about. In other words, "it" definitely works
> > for non-auto-generated names:
> >
> > describe Thing do
> >   it "should do stuff" do
> >
> > I'm specifically looking for an alias that works well for
> > auto-generated names, so if "the" only works well in that situation
> > I'm OK w/ that.
> >
> > The thing I'm wondering is whether "the" would work for the majority
> > of auto-generated-name examples, and whether it pushes you
> > psychologically towards a certain type of example. It makes sense when
> > you say:
> >
> > describe Thing do
> >   the { @thing.should do_something }
> >
> > or.....
> >
> > describe Thing do
> >   a { @thing.should do_something }
> >
> > But what other shapes do we need to consider?
> >
>
> 'a' or 'the' could cover almost everything when talking of a specific
> model/object instance, like the examples I provided.
>
> for other cases, like the ones present in examples/ folder
> (auto_spec_description_example.rb) will sound a bit awkward:
>
>   it { 3.should be < 5 }
>
>   it { ["a"].should include("a") }
>
>   it { [1,2,3].should respond_to(:size) }
>
>
> WTH, even 'it' sounds weird in that context.

Those examples have not grown w/ the framework - we need to revisit them.

>
> --
> 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
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list