Sha256: 66b1f9f828b9d0429b71f3461ec0ee538f935086fb808457fbc5438e51d6bccf

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

require File.dirname(__FILE__) + '/../../test_helper'
module Spec
  module Runner
    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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-0.5.12 test/spec/runner/rdoc_formatter_test.rb
rspec-0.5.11 test/spec/runner/rdoc_formatter_test.rb
rspec-0.5.10 test/spec/runner/rdoc_formatter_test.rb