test/unit/result_tests.rb in assert-2.10.1 vs test/unit/result_tests.rb in assert-2.11.0

- old
+ new

@@ -2,11 +2,11 @@ require 'assert/result' module Assert::Result class BacktraceTests < Assert::Context - desc "a result backtrace" + desc "Assert::Result::Backtrace" setup do @backtrace = Backtrace.new(caller) end subject { @backtrace } @@ -28,12 +28,12 @@ assert_equal ["No backtrace"], Backtrace.new end end - class UnitTests < Assert::Context - desc "a base result" + class BaseTests < Assert::Context + desc "Assert::Result::Base" setup do @test = Factory.test("a test name") @result = Assert::Result::Base.new(@test, "a message", ["line 1", "line2"]) end subject{ @result } @@ -71,14 +71,10 @@ assert_kind_of Assert::Result::Backtrace, subject.backtrace assert_equal ['bt'], subject.backtrace end - end - - class ToStringTests < UnitTests - should "include its test context name in the to_s" do assert subject.to_s.include?(subject.test_name) end should "include its test name in the to_s" do @@ -97,18 +93,18 @@ assert_equal subject.backtrace.filtered.first, subject.trace end end class PassTests < Assert::Context - desc "a pass result" + desc "Assert::Result::Pass" setup do @test = Factory.test("a test name") @result = Assert::Result::Pass.new(@test, "passed", []) end subject { @result } - should "be pass?" do + should "pass?" do assert_equal true, subject.pass? end Assert::Result.types.keys.reject{|k| k == :pass}.each do |type| should "not be #{type}?" do @@ -129,18 +125,18 @@ end end class IgnoreTests < Assert::Context - desc "an ignore result" + desc "Assert::Result::Ignore" setup do @test = Factory.test("a test name") @result = Assert::Result::Ignore.new(@test, "ignored", []) end subject { @result } - should "be ignore?" do + should "ignore?" do assert_equal true, subject.ignore? end Assert::Result.types.keys.reject{|k| k == :ignore}.each do |type| should "not be #{type}?" do @@ -161,22 +157,22 @@ end end class FailTests < Assert::Context - desc "a fail result" + desc "Assert::Result::Fail" setup do @test = Factory.test("a test name") @result = Assert::Result::Fail.new(@test, "failed", []) end subject { @result } should "use a runtime error (TestFailure) for controlling flow" do assert_kind_of RuntimeError, Assert::Result::TestFailure.new end - should "be fail?" do + should "fail?" do assert_equal true, subject.fail? end Assert::Result.types.keys.reject{|k| k == :fail}.each do |type| should "not be #{type}?" do @@ -197,11 +193,11 @@ end end class SkipTests < Assert::Context - desc "a skip result" + desc "Assert::Result::Skip" setup do @test = Factory.test("a test name") @exception = nil begin raise TestSkipped, "test ski[" @@ -214,11 +210,11 @@ should "use a runtime error (TestSkipped) for controlling flow" do assert_kind_of RuntimeError, Assert::Result::TestSkipped.new end - should "be skip?" do + should "skip?" do assert_equal true, subject.skip? end Assert::Result.types.keys.reject{|k| k == :skip}.each do |type| should "not be #{type}?" do @@ -239,11 +235,11 @@ end end class ErrorTests < Assert::Context - desc "an error result" + desc "Assert::Result::Error" setup do @test = Factory.test("a test name") @exception = nil begin raise Exception, "test error" @@ -252,10 +248,10 @@ end @result = Assert::Result::Error.new(@test, @exception) end subject { @result } - should "be error?" do + should "error?" do assert_equal true, subject.error? end Assert::Result.types.keys.reject{|k| k == :error}.each do |type| should "not be #{type}?" do