Sha256: 1b74c481dc501431714e57f64872a591011977645a83910d0bfb888067ecd985

Contents?: true

Size: 1.1 KB

Versions: 8

Compression:

Stored size: 1.1 KB

Contents

require 'assert'
require 'assert/context/suite_dsl'

require 'assert/suite'

module Assert::Context::SuiteDSL

  class UnitTests < Assert::Context
    desc "Assert::Context::SuiteDSL"
    setup do
      @custom_suite = Factory.modes_off_suite
      @context_class = Factory.context_class
    end
    subject{ @context_class }

    should "use `Assert.suite` by default" do
      assert_equal Assert.suite, subject.suite
    end

    should "use any given custom suite" do
      subject.suite(@custom_suite)
      assert_equal @custom_suite, subject.suite
    end

  end

  class SuiteFromParentTests < UnitTests
    desc "`suite` method using parent context"
    setup do
      @parent_class = Factory.context_class
      @parent_class.suite(@custom_suite)
      @context_class = Factory.context_class(@parent_class)
    end

    should "default to it's parent's suite" do
      assert_equal @custom_suite, subject.suite
    end

    should "use any given custom suite" do
      another_suite = Factory.modes_off_suite
      subject.suite(another_suite)
      assert_equal another_suite, subject.suite
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
assert-2.16.5 test/unit/context/suite_dsl_tests.rb
assert-2.16.4 test/unit/context/suite_dsl_tests.rb
assert-2.16.3 test/unit/context/suite_dsl_tests.rb
assert-2.16.2 test/unit/context/suite_dsl_tests.rb
assert-2.16.1 test/unit/context/suite_dsl_tests.rb
assert-2.16.0 test/unit/context/suite_dsl_tests.rb
assert-2.15.2 test/unit/context/suite_dsl_tests.rb
assert-2.15.1 test/unit/context/suite_dsl_tests.rb