test/unit/result_tests.rb in assert-2.1.2 vs test/unit/result_tests.rb in assert-2.2.0

- old
+ new

@@ -38,10 +38,11 @@ end subject{ @result } should have_readers :test, :message, :backtrace should have_imeths :test_name, :name, :to_sym, :to_s, :trace + should have_imeth :set_backtrace Assert::Result.types.keys.each do |type| should "respond to the instance method ##{type}?" do assert_respond_to "#{type}?", subject end @@ -60,9 +61,16 @@ end should "show only its class and message when inspected" do exp = "#<#{subject.class} @message=#{subject.message.inspect}>" assert_equal exp, subject.inspect + end + + should "allow overriding the result backtrace with `set_backtrace`" do + subject.set_backtrace(['bt']) + + assert_kind_of Assert::Result::Backtrace, subject.backtrace + assert_equal ['bt'], subject.backtrace end end class ToStringTests < BaseTests