Module: RR::Adapters::Rspec

Includes:
RRMethods
Defined in:
lib/rr/adapters/rspec.rb

Defined Under Namespace

Classes: InvocationMatcher

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from RRMethods

#any_times, #anything, #boolean, #dont_allow, #duck_type, #hash_including, #instance_of, #is_a, #mock, #new_instance_of, #numeric, #proxy, #received, #reset, #satisfy, #spy, #strong, #stub, #verify

Methods included from DoubleDefinitions::Strategies::StrategyMethods

#any_instance_of!, #dont_allow!, #instance_of!, #mock!, #proxy!, #strong!, #stub!

Class Method Details

+ (Object) included(mod)



4
5
6
7
8
9
# File 'lib/rr/adapters/rspec.rb', line 4

def self.included(mod)
  patterns = ::Spec::Runner::QuietBacktraceTweaker::IGNORE_PATTERNS
  unless patterns.include?(RR::Errors::BACKTRACE_IDENTIFIER)
    patterns.push(RR::Errors::BACKTRACE_IDENTIFIER)
  end
end

Instance Method Details

- (Object) have_received(method = nil)



22
23
24
# File 'lib/rr/adapters/rspec.rb', line 22

def have_received(method = nil)
  InvocationMatcher.new(method)
end

- (Object) setup_mocks_for_rspec



12
13
14
# File 'lib/rr/adapters/rspec.rb', line 12

def setup_mocks_for_rspec
  RR.reset
end

- (Object) teardown_mocks_for_rspec



18
19
20
# File 'lib/rr/adapters/rspec.rb', line 18

def teardown_mocks_for_rspec
  RR.reset
end

- (Object) verify_mocks_for_rspec



15
16
17
# File 'lib/rr/adapters/rspec.rb', line 15

def verify_mocks_for_rspec
  RR.verify
end