Sha256: 5055edf9ab8c37d59a546c68ced99c4ee21028e63ed46d108172229592d460ff

Contents?: true

Size: 1.33 KB

Versions: 3

Compression:

Stored size: 1.33 KB

Contents

require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../../../common/adapter_integration_tests', __FILE__)

describe 'Test::Unit 2 integration' do
  include AdapterIntegrationTests

  def bootstrap(opts={})
    str = ""
    str << "require 'rubygems'\n"
    str << "require 'rr'\n" if opts[:include_rr_before]
    str << "require 'test/unit'\n"
    str << "require 'rr'\n" unless opts[:include_rr_before]
    str
  end

  def error_test
    <<-EOT
      #{bootstrap}

      class FooTest < Test::Unit::TestCase
        def test_foo
          object = Object.new
          mock(object).foo
        end
      end
    EOT
  end

  def include_adapter_test
    <<-EOT
      #{bootstrap}

      class Test::Unit::TestCase
        include RR::Adapters::TestUnit
      end

      class FooTest < Test::Unit::TestCase
        def test_foo
          object = Object.new
          mock(object).foo
          object.foo
        end
      end
    EOT
  end

  def include_adapter_where_rr_included_before_test_framework_test
    <<-EOT
      #{bootstrap :include_rr_before => true}

      class Test::Unit::TestCase
        include RR::Adapters::TestUnit
      end

      class FooTest < Test::Unit::TestCase
        def test_foo
          object = Object.new
          mock(object).foo
          object.foo
        end
      end
    EOT
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rr-1.1.0 spec/suites/rspec_1/integration/test_unit_2_spec.rb
rr-1.1.0.rc3 spec/suites/rspec_1/integration/test_unit_2_spec.rb
rr-1.1.0.rc2 spec/suites/rspec_1/integration/test_unit_2_spec.rb