test/unit/result_tests.rb in assert-2.17.0 vs test/unit/result_tests.rb in assert-2.18.0

- old
+ new

@@ -2,11 +2,10 @@ require "assert/result" require "assert/file_line" module Assert::Result - class UnitTests < Assert::Context desc "Assert::Result" setup do @test = Factory.test("a test name") end @@ -37,11 +36,10 @@ def build_backtrace assert_lib_path = File.join(ROOT_PATH, "lib/#{Factory.string}:#{Factory.integer}") (Factory.integer(3).times.map{ Factory.string } + [assert_lib_path]).shuffle end - end class BaseTests < UnitTests desc "Base" setup do @@ -231,11 +229,10 @@ "@message=#{subject.message.inspect} "\ "@file_line=#{subject.file_line.to_s.inspect} "\ "@test_file_line=#{subject.test_file_line.to_s.inspect}>" assert_equal exp, subject.inspect end - end class PassTests < UnitTests desc "Pass" setup do @@ -246,11 +243,10 @@ should "know its type/name" do assert_equal :pass, subject.type assert_equal :pass, subject.class.type assert_equal "Pass", subject.class.name end - end class IgnoreTests < UnitTests desc "Ignore" setup do @@ -261,11 +257,10 @@ should "know its type/name" do assert_equal :ignore, subject.type assert_equal :ignore, subject.class.type assert_equal "Ignore", subject.class.name end - end class HaltingTestResultErrorTests < UnitTests desc "HaltingTestResultError" subject{ HaltingTestResultError.new } @@ -273,21 +268,19 @@ should have_accessors :assert_with_bt should "be a runtime error" do assert_kind_of RuntimeError, subject end - end class TestFailureTests < UnitTests desc "TestFailure" subject{ TestFailure } should "be a halting test result error" do assert_kind_of HaltingTestResultError, subject.new end - end class FailTests < UnitTests desc "Fail" setup do @@ -324,21 +317,19 @@ end should "not allow creating for a test with non-TestFailure exceptions" do assert_raises(ArgumentError){ Fail.for_test(@test, RuntimeError.new) } end - end class TestSkippedTests < UnitTests desc "TestSkipped" subject{ TestSkipped } should "be a halting test result error" do assert_kind_of HaltingTestResultError, subject.new end - end class SkipTests < UnitTests desc "Skip" setup do @@ -375,11 +366,10 @@ end should "not allow creating for a test with non-TestSkipped exceptions" do assert_raises(ArgumentError){ Skip.for_test(@test, RuntimeError.new) } end - end class ErrorTests < UnitTests desc "Error" setup do @@ -406,11 +396,10 @@ end should "not allow creating for a test without an exception" do assert_raises(ArgumentError){ Error.for_test(@test, Factory.string) } end - end class BacktraceTests < UnitTests desc "Backtrace" setup do @@ -442,9 +431,7 @@ end should "default itself when created from nil" do assert_equal ["No backtrace"], Backtrace.new end - end - end