[rspec-users] given_it

Yurii Rashkovskii yrashk at gmail.com
Fri Sep 21 16:12:50 EDT 2007

>> Sure! But they are not the same stuff. What I was looking for is
>> it "should do #1" do
>>   ...
>> end
>> it "should do X after #1" do
>>   given_it "should do #1"
>>   should do_x
>> end
>> it "should do Y after #1" do
>>   given_it "should do #1"
>>   should do_y
>> end
>> it "should do Z after #1 Y" do
>>   given_it "should do Y after #1"
>>   should do_z
>> end
> Sorry mate - that just seems like endless confusion - the examples
> should never rely on each other that way - different animal from
> scenarios that involve steps.

I agree that they should not rely on each other _indirectly_. But why  
they should not _reuse_ each other? I find it very useful for  
testing, say, different aspects of, say, controller's behavior. I  
simply do not want to put all checks into one example, like it should  
do this, this and this and in result we should have this, this and  
that. How do you propose to test different aspects of single actions  
in a nice way?

More information about the rspec-users mailing list