Sha256: 86c54d4d655a89bf3f0a376c96bcea34b29d519bf01b700bb720f92f540f644a

Contents?: true

Size: 1.1 KB

Versions: 15

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 parents subject block" 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

15 entries across 15 versions & 1 rubygems

Version Path
assert-2.15.0 test/unit/context/suite_dsl_tests.rb
assert-2.14.0 test/unit/context/suite_dsl_tests.rb
assert-2.13.0 test/unit/context/suite_dsl_tests.rb
assert-2.12.2 test/unit/context/suite_dsl_tests.rb
assert-2.12.1 test/unit/context/suite_dsl_tests.rb
assert-2.12.0 test/unit/context/suite_dsl_tests.rb
assert-2.11.0 test/unit/context/suite_dsl_tests.rb
assert-2.10.1 test/unit/context/suite_dsl_tests.rb
assert-2.10.0 test/unit/context/suite_dsl_tests.rb
assert-2.9.0 test/unit/context/suite_dsl_tests.rb
assert-2.8.0 test/unit/context/suite_dsl_tests.rb
assert-2.7.1 test/unit/context/suite_dsl_tests.rb
assert-2.7.0 test/unit/context/suite_dsl_tests.rb
assert-2.6.0 test/unit/context/suite_dsl_tests.rb
assert-2.5.0 test/unit/context/suite_dsl_tests.rb