Class: RR::Integrations::RSpec2

Inherits:
Object
  • Object
show all
Defined in:
lib/rr/integrations/rspec_2.rb

Defined Under Namespace

Modules: Mixin

Instance Method Summary collapse

Instance Method Details

#applies?Boolean

Returns:

  • (Boolean)


26
27
28
29
30
# File 'lib/rr/integrations/rspec_2.rb', line 26

def applies?
  defined?(::RSpec) &&
  defined?(::RSpec::Core::Version::STRING) &&
  ::RSpec::Core::Version::STRING =~ /^2/
end

#hookObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/rr/integrations/rspec_2.rb', line 32

def hook
  ::RSpec.configure do |config|
    config.mock_with Mixin
    config.include RR::DSL
  end

  patterns =
    if ::RSpec.configuration.respond_to?(:backtrace_exclusion_patterns)
      ::RSpec.configuration.backtrace_exclusion_patterns
    else
      ::RSpec.configuration.backtrace_clean_patterns
    end

  unless patterns.include?(RR::Errors::BACKTRACE_IDENTIFIER)
    patterns.push(RR::Errors::BACKTRACE_IDENTIFIER)
  end
end

#nameObject



22
23
24
# File 'lib/rr/integrations/rspec_2.rb', line 22

def name
  'RSpec 2'
end