Sha256: 5b87442fb5a4cdf655bfe955713443a57fca449e4f9b6f453beceebc1ce9a0b0

Contents?: true

Size: 680 Bytes

Versions: 31

Compression:

Stored size: 680 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper.rb'

class TestNestedLifecycle < Test::Unit::TestCase
  before :all  do
    @var = 0
  end
  
  before do
    @var += 1
  end
  context "A new context" do
    before do
      @var += 1
    end
    
    before :all do
      @var = 0
    end
    
    context "A nested context" do
      before do
        @var += 1
      end
      
      before :all do
        @var += 1
      end

      context "A second, nested context" do
        before do
          @var += 1
        end

        before :all do
          @var += 1
        end

        it "should set var" do
          assert_equal 6, @var
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 5 rubygems

Version Path
tu-context-0.5.7 test/test_nested_lifecycle.rb
mcmire-context-0.5.6 test/test_nested_lifecycle.rb
poolparty-1.3.15 vendor/gems/context/test/test_nested_lifecycle.rb
poolparty-1.3.14 vendor/gems/context/test/test_nested_lifecycle.rb
poolparty-1.3.13 vendor/gems/context/test/test_nested_lifecycle.rb
poolparty-1.3.8 vendor/gems/context/test/test_nested_lifecycle.rb
poolparty-1.3.7 vendor/gems/context/test/test_nested_lifecycle.rb
poolparty-1.3.6 vendor/gems/context/test/test_nested_lifecycle.rb
poolparty-1.3.4 vendor/gems/context/test/test_nested_lifecycle.rb
poolparty-1.3.3 vendor/gems/context/test/test_nested_lifecycle.rb
poolparty-1.3.1 vendor/gems/context/test/test_nested_lifecycle.rb