Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #3103 > unrolled thread

Rspec Before/After All/Each order of operation

Started bydonvnielsen <donvnielsen@gmail.com>
First post2011-04-18 08:26 -0700
Last post2011-04-19 22:20 -0500
Articles 2 — 2 participants

Back to article view | Back to comp.lang.ruby


Contents

  Rspec Before/After All/Each order of operation donvnielsen <donvnielsen@gmail.com> - 2011-04-18 08:26 -0700
    Re: Rspec Before/After All/Each order of operation Roger Pack <rogerpack2005@gmail.com> - 2011-04-19 22:20 -0500

#3103 — Rspec Before/After All/Each order of operation

Fromdonvnielsen <donvnielsen@gmail.com>
Date2011-04-18 08:26 -0700
SubjectRspec Before/After All/Each order of operation
Message-ID<04da7e75-001a-46c5-a751-d037fa0f5582@o21g2000prh.googlegroups.com>
I'm using Rspec for testing.  I'm seeking confirmation of the
following, that the way it is laid out is how it is supposed to
function.  Rspec is supposed to test the inner describe Before(:all)
before it tests the outer describe before(:each).  I can see how it
should be that way, in that the inner Before(:all) is probably more
important to the inner describe function than the outer
before(:each).  It just feels a little un-intuitive that way.  I just
want to make sure that is exactly as planned.  Thanks for your time.


describe ClassNameHere,'Outer test wrapper' do

  before(:all) do   # (01)
    puts '(1) First in operation'
  end

  before(:each) do
    puts '(3) Third in operation'
  end

  after(:each) do
    puts '(4) Fourth in operation'
  end

  after(:all) do
    puts '(5) Last in operation - cleanup my mess'
  end

  describe 'Inner test wrapper #1' do
    before(:all) do
      puts '(2a) Second operation'
    end
  end

  describe 'Inner test wrapper #2' do
    before(:all) do
      puts '(2b) I got here - no tmp'
    end
  end


end

[toc] | [next] | [standalone]


#3204

FromRoger Pack <rogerpack2005@gmail.com>
Date2011-04-19 22:20 -0500
Message-ID<95038dd754dadffa5b0591af09aac155@ruby-forum.com>
In reply to#3103
maybe repost to the rspec group? They're usually quite responsive.

-- 
Posted via http://www.ruby-forum.com/.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.ruby


csiph-web