Sha256: 5af221f52cdf1990df2f4a50c3f0aae2234eb909eac7b499167a0894f4c3a9f0

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

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

describe 'Integration between TestUnit and Rails' do
  include AdapterIntegrationTests
  include IntegrationWithRails

  def additional_bootstrap
    <<-EOT
      require 'rails'
      require 'active_support'
    EOT
  end

  def test_framework_path
    'test/unit'
  end

  def error_test
    <<-EOT
      #{bootstrap}

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

  def include_adapter_test
    <<-EOT
      #{bootstrap}

      class ActiveSupport::TestCase
        include RR::Adapters::TestUnit
      end

      class FooTest < ActiveSupport::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 ActiveSupport::TestCase
        include RR::Adapters::TestUnit
      end

      class FooTest < ActiveSupport::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_2/integration/test_unit_rails_spec.rb
rr-1.1.0.rc3 spec/suites/rspec_2/integration/test_unit_rails_spec.rb
rr-1.1.0.rc2 spec/suites/rspec_2/integration/test_unit_rails_spec.rb