test/minitest/reporter_test.rb in minitest-reporters-0.9.0 vs test/minitest/reporter_test.rb in minitest-reporters-0.10.0

- old
+ new

@@ -4,46 +4,46 @@ class ReporterTest < TestCase def setup klass = Class.new do include MiniTest::Reporter end - + @reporter = klass.new end - - test 'callbacks' do + + def test_callbacks [ :before_suites, :after_suite, :before_suite, :after_suite, :before_test, :pass, :skip, :failure, :error ].each { |method| assert_respond_to @reporter, method } end - - test '#runner' do + + def test_runner assert_kind_of MiniTest::Unit, @reporter.runner end - - test '#output' do + + def test_output assert_equal MiniTest::Unit.output, @reporter.output end - - test '#verbose?' do + + def test_verbose refute @reporter.verbose? - + begin @reporter.runner.verbose = true assert @reporter.verbose? ensure @reporter.runner.verbose = false end end - - test '#print' do - @reporter.output.expects(:print).with('foo') + + def test_print + mock(@reporter.output).print('foo') @reporter.print('foo') end - - test '#puts' do - @reporter.output.expects(:puts).with('foo') + + def test_puts + mock(@reporter.output).puts('foo') @reporter.puts('foo') end end end