[rspec-users] nested describe blocks

Zach Dennis zach.dennis at gmail.com
Thu Oct 4 19:31:38 EDT 2007


In 1.0.8 I am able to nest describe blocks, but in moving to trunk,
revision 2971, I am unable to have the expected results.  Here is an
example nested describe block:

describe "foo" do
  describe "with no arguments" do
    before do
      puts "a"
    end

    it "should" do
      puts "SHOULD"
    end
  end

  describe "with invalid arguments" do
    before do
      puts "b"
    end

    it "shouldn't" do
      puts "SHOULDN'T"
    end
  end
end

Here is the output in trunk (revision 2971):

a
b
SHOULD
a
b
SHOULDN'T

Here is the output with 1.0.8:

a
SHOULD
b
SHOULDN'T

The 1.0.8 output is what I expect. I don't believe this is a *feature*
of rspec in the first place, just an not-so-ordinary way to organize
some specs. Any chance of having this work as I expect?

Zach


-- 
Zach Dennis
http://www.continuousthinking.com


More information about the rspec-users mailing list