Sha256: 5b0afca9b1676d84436682154ad9ec9ee82f05f1076b509b5e36f682dc754274

Contents?: true

Size: 1.35 KB

Versions: 9

Compression:

Stored size: 1.35 KB

Contents

require File.dirname(__FILE__) + '/../../../test_helper'
module Spec
  module Runner
    module Formatter
      class RdocFormatterTest < Test::Unit::TestCase

        def setup
          @io = StringIO.new
          @formatter = RdocFormatter.new(@io, true)
        end

        def test_should_push_out_context
          @formatter.add_context("context", :ignored)
          assert_equal("# context\n", @io.string)
        end

        def test_should_push_out_spec
          @formatter.spec_passed("spec")
          assert_equal("# * spec\n", @io.string)
        end

        def test_should_push_out_failed_spec
          @formatter.spec_failed("spec", 98, nil)
          assert_equal("# * spec [98 - FAILED]\n", @io.string)
        end
      
        def test_should_produce_no_summary
          @formatter.dump_summary(nil,nil,nil)
          assert(@io.string.empty?)
        end

        def test_should_produce_nothing_on_start_dump
          @formatter.start_dump
          assert(@io.string.empty?)
        end

      end
      class RdocFormatterDryRunTest < Test::Unit::TestCase
        def setup
          @io = StringIO.new
          @formatter = RdocFormatter.new(@io, true)
        end
      
        def test_should_not_produce_summary_on_dry_run
          @formatter.dump_summary(3,2,1)
          assert_equal("", @io.string)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rspec-0.5.13 test/spec/runner/formatter/rdoc_formatter_test.rb
rspec-0.5.14 test/spec/runner/formatter/rdoc_formatter_test.rb
rspec-0.5.15 test/spec/runner/formatter/rdoc_formatter_test.rb
rspec-0.5.16 test/spec/runner/formatter/rdoc_formatter_test.rb
rspec-0.6.0 test/spec/runner/formatter/rdoc_formatter_test.rb
rspec-0.6.1 test/spec/runner/formatter/rdoc_formatter_test.rb
rspec-0.6.2 test/spec/runner/formatter/rdoc_formatter_test.rb
rspec-0.6.3 test/spec/runner/formatter/rdoc_formatter_test.rb
rspec-0.6.4 test/spec/runner/formatter/rdoc_formatter_test.rb