[rspec-users] "they" synonym for "it"?

David Chelimsky dchelimsky at gmail.com
Wed Jul 11 09:29:26 EDT 2007


On 7/11/07, Wincent Colaiuta <win at wincent.com> wrote:
> El 11/7/2007, a las 12:42, Ashley Moran escribió:
>
> > I've noticed that I phrase a lot of shared behaviours in plural, eg
> >
> >    describe "All payment_details views"
> >
> > How about a "they" alias to "it" so you can write
> >
> >    describe "All payment_details views", :shared => true do
> >      they "should have a card number field" do
> >        # ...
> >      end
> >    end
> >
> > WDYT?
>
> In a case like this, isn't "All" the same as "any" or even "a", or
> even omitting the article entirely?
>
> For example:
>
>    describe 'Any payment_details view' do
>      it 'should have a card number field' do
>        ...
>
>    describe 'A payment_details view' do
>      it 'should have a card number field' do
>        ...
>
>    describe 'payment_details view' do
>      it 'should have a card number field' do
>        ...
>
>    # or whatever the class is called
>    describe PaymentDetailsView do
>      it 'should have a card number field' do
>        ...

Excellent point. I'm sure the code in each example would be dealing
with a single object, not all objects.

>
> Cheers,
> Wincent
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list