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

- old
+ new

@@ -1,9 +1,9 @@ -require 'assert' -require 'assert/result' +require "assert" +require "assert/result" -require 'assert/file_line' +require "assert/file_line" module Assert::Result class UnitTests < Assert::Context desc "Assert::Result" @@ -68,11 +68,11 @@ should have_imeths *Assert::Result.types.keys.map{ |k| "#{k}?" } should have_imeths :to_sym, :to_s should "know its class-level type/name" do assert_equal :unknown, subject.class.type - assert_equal '', subject.class.name + assert_equal "", subject.class.name end should "know how to build a result for a given test" do message = Factory.text bt = Factory.integer(3).times.map{ Factory.string } @@ -103,17 +103,17 @@ should "default its attrs" do result = Base.new({}) assert_equal :unknown, result.type - assert_equal '', result.name - assert_equal '', result.test_name - assert_equal Assert::FileLine.parse(''), result.test_file_line - assert_equal '', result.message - assert_equal '', result.output + assert_equal "", result.name + assert_equal "", result.test_name + assert_equal Assert::FileLine.parse(""), result.test_file_line + assert_equal "", result.message + assert_equal "", result.output assert_equal Backtrace.new([]), result.backtrace - assert_equal '', result.trace + assert_equal "", result.trace end should "know its test file line attrs" do exp = @given_data[:test_file_line] assert_equal exp.file, subject.test_file_name @@ -210,12 +210,12 @@ assert_includes subject.message, str assert_includes subject.trace, str assert_equal 3, str.split("\n").count - Assert.stub(subject, :message){ '' } - Assert.stub(subject, :trace){ '' } + Assert.stub(subject, :message){ "" } + Assert.stub(subject, :trace){ "" } assert_equal 1, subject.to_s.split("\n").count end should "know if it is equal to another result" do @@ -225,11 +225,11 @@ Assert.stub(other, [:type, :message].sample){ Factory.string } assert_not_equal other, subject end should "show only its class and message when inspected" do - exp = "#<#{subject.class}:#{'0x0%x' % (subject.object_id << 1)} "\ + exp = "#<#{subject.class}:#{"0x0%x" % (subject.object_id << 1)} "\ "@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 @@ -244,11 +244,11 @@ subject { @result } should "know its type/name" do assert_equal :pass, subject.type assert_equal :pass, subject.class.type - assert_equal 'Pass', subject.class.name + assert_equal "Pass", subject.class.name end end class IgnoreTests < UnitTests @@ -259,11 +259,11 @@ subject { @result } should "know its type/name" do assert_equal :ignore, subject.type assert_equal :ignore, subject.class.type - assert_equal 'Ignore', subject.class.name + assert_equal "Ignore", subject.class.name end end class HaltingTestResultErrorTests < UnitTests @@ -296,11 +296,11 @@ subject { @result } should "know its type/name" do assert_equal :fail, subject.type assert_equal :fail, subject.class.type - assert_equal 'Fail', subject.class.name + assert_equal "Fail", subject.class.name end should "allow creating for a test with TestFailure exceptions" do err = TestFailure.new err.set_backtrace(build_backtrace) @@ -347,11 +347,11 @@ subject { @result } should "know its type/name" do assert_equal :skip, subject.type assert_equal :skip, subject.class.type - assert_equal 'Skip', subject.class.name + assert_equal "Skip", subject.class.name end should "allow creating for a test with TestSkipped exceptions" do err = TestSkipped.new err.set_backtrace(build_backtrace) @@ -387,10 +387,10 @@ end subject { @result } should "know its class-level type/name" do assert_equal :error, subject.class.type - assert_equal 'Error', subject.class.name + assert_equal "Error", subject.class.name end should "allow creating for a test with exceptions" do err = Exception.new err.set_backtrace(build_backtrace)