Sha256: 5e6cd0e4f0acbbccf38635231ca114e64ce97d986d1852694d75356d162f389b

Contents?: true

Size: 1.5 KB

Versions: 3

Compression:

Stored size: 1.5 KB

Contents

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

describe 'Integration with RSpec 1' do
  include AdapterTests
  instance_methods.each do |method_name|
    if method_name =~ /^test_(.+)$/
      it(method_name) { __send__(method_name) }
    end
  end

  include AdapterIntegrationTests

  def assert_equal(expected, actual)
    actual.should be == expected
  end

  def assert_raise(error, message=nil, &block)
    expect(&block).to raise_error(error, message)
  end

  def test_framework_path
    'spec/autorun'
  end

  def error_test
    <<-EOT
      #{bootstrap}

      describe 'A test' do
        it 'is a test' do
          object = Object.new
          mock(object).foo
        end
      end
    EOT
  end

  def include_adapter_test
    <<-EOT
      #{bootstrap}

      Spec::Runner.configure do |c|
        c.mock_with :rr
      end

      describe 'A test' do
        it 'is a test' do
          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}

      Spec::Runner.configure do |c|
        c.mock_with :rr
      end

      describe 'A test' do
        it 'is a test' do
          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/rspec_1_spec.rb
rr-1.1.0.rc3 spec/suites/rspec_1/integration/rspec_1_spec.rb
rr-1.1.0.rc2 spec/suites/rspec_1/integration/rspec_1_spec.rb