[rspec-devel] need help getting a word right

Dan North dan at tastapod.com
Thu Jul 19 16:03:57 EDT 2007


How about "should" and "example", depending on whether you like braces 
or not:

describe Sheep do
    before :each do
       @sheep = Sheep.new
    end

    example { @sheep.should say('baa') }

    should do
        @sheep.should say('baa')
    end
end

Thinking about the use case for this, the no-description examples will 
most likely be one-liners. Anything more and you would use a description 
to say what the intent of the example is, so using example {...} seems 
most congruent to me.

Having said that, I find I always provide a description even if the 
example is trivial - like having a method name for a one-line method - 
so I'm out on a limb here :)

Cheers,
Dan


David Chelimsky wrote:
> Hey all,
>
> I see examples showing up that look like this:
>
> describe Thing do
>   before(:each) do
>     @thing = Thing.new
>   end
>
>   it do
>     @thing.should be_something
>   end
> end
>
> This will produce output like this:
>
> Thing
> - should be something
>
> But "it do" is driving me mad :(
>
> We need a better word. Of course, 'specify' has not been completely
> removed, so you can still do this:
>
> describe Thing do
>   before(:each) { @thing = Thing.new }
>   specify { @thing.should be_something }
> end
>
> Consise? Yes. But I'm not psyched about 'specify' either. There IS a
> perfect word for this situation. What is it? Suggestions?
>
> Thanks,
> David
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>   



More information about the rspec-devel mailing list