Sha256: 58bc0a591f5295e30609c5d621210b5ae1cf33938a2d01dbef7645fd5b57652a

Contents?: true

Size: 814 Bytes

Versions: 42

Compression:

Stored size: 814 Bytes

Contents

# --- add this as spec/support/rr.rb ---

# RR doesn't have support for RSpec 2.
#
# Source: <https://github.com/btakita/rr/issues#issue/45>

require 'rr'

module RR
  module Adapters
    module RSpec2
      include RRMethods

      def setup_mocks_for_rspec
        RR.reset
      end
      def verify_mocks_for_rspec
        RR.verify
      end
      def teardown_mocks_for_rspec
        RR.reset
      end

      def have_received(method = nil)
        RR::Adapters::Rspec::InvocationMatcher.new(method)
      end
    end
  end
end

module RSpec
  module Core
    module MockFrameworkAdapter
      include RR::Adapters::RSpec2
    end
  end
end

RSpec.configure do |config|
  config.mock_framework = RSpec::Core::MockFrameworkAdapter
  config.backtrace_clean_patterns.push(RR::Errors::BACKTRACE_IDENTIFIER)
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
remnant-0.4.2 spec/support/rr.rb
remnant-0.4.1 spec/support/rr.rb
remnant-0.4.0 spec/support/rr.rb
remnant-0.3.3 spec/support/rr.rb
remnant-0.3.2 spec/support/rr.rb
remnant-0.3.1 spec/support/rr.rb
remnant-0.3.0 spec/support/rr.rb
remnant-0.2.4 spec/support/rr.rb
remnant-0.2.3 spec/support/rr.rb
flail-0.1.5 spec/support/rr.rb
flail-0.1.4 spec/support/rr.rb
remnant-0.2.2 spec/support/rr.rb
remnant-0.2.1 spec/support/rr.rb
remnant-0.2.0 spec/support/rr.rb
remnant-0.1.3 spec/support/rr.rb
remnant-0.1.2 spec/support/rr.rb
remnant-0.1.1 spec/support/rr.rb
remnant-0.1.0 spec/support/rr.rb
flail-0.1.3 spec/support/rr.rb
flail-0.1.2 spec/support/rr.rb