Sha256: 9acf9fb09ab2885bc065224af7bc32e6568f90333adb174a8f49605a813c6843

Contents?: true

Size: 1.49 KB

Versions: 9

Compression:

Stored size: 1.49 KB

Contents

# encoding: UTF-8

require File.expand_path('../../test_helper', __FILE__)

$suite1_start = $suite2_start = $suite3_start = nil

describe "Suite1" do
  start do
    $suite1_start = true
  end

  finish do
    $suite1_start = false
  end

  it "1" do
    assert $suite1_start
  end

  describe "a" do
    it "1" do
      assert $suite1_start
    end

    it "2" do
      assert true
    end

    describe "a" do
      it "1" do
        assert true
      end

      it "2" do
        assert $suite1_start
        $suite2_start.must_be_nil
      end
    end
  end
end

describe "Suite2a" do
  it "a" do
    assert $suite1_start == false
  end
end

describe "Suite2b" do
  start do
    $suite2_start = true
  end

  finish do
    $suite2_start = false
  end

  it "a" do
    assert $suite1_start == false
    assert $suite2_start
    $suite3_start.must_be_nil
  end
end

describe "Suite3" do
  start do
    $suite3_start = true
  end

  finish do
    $suite3_start = false
  end

  it "1" do
    assert $suite1_start == false
    assert $suite2_start == false
    assert $suite3_start
  end

  describe "a" do
    it "1" do
      assert $suite1_start == false
      assert $suite2_start == false
      assert $suite3_start
    end

    describe "a" do
      it "2" do
        assert $suite3_start
      end
    end
  end
  describe "a" do
    it "2" do
      assert $suite3_start
    end
  end
end

MiniTest::Unit.after_tests do
  if $suite3_start
    raise "$suite3_start should be false but is #{$suite3_start.inspect}"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta10 test/support/test_start_finish.rb
spontaneous-0.2.0.beta9 test/support/test_start_finish.rb
spontaneous-0.2.0.beta8 test/support/test_start_finish.rb
spontaneous-0.2.0.beta7 test/support/test_start_finish.rb
spontaneous-0.2.0.beta6 test/support/test_start_finish.rb
spontaneous-0.2.0.beta5 test/support/test_start_finish.rb
spontaneous-0.2.0.beta4 test/support/test_start_finish.rb
spontaneous-0.2.0.beta3 test/support/test_start_finish.rb
spontaneous-0.2.0.beta2 test/support/test_start_finish.rb