Module: ArchUnit::Testing::RSpecAdapter

Defined in:
lib/archunit/testing/rspec_adapter.rb

Overview

Installs the native expect(rule).to pass matcher when RSpec is already loaded.

Class Method Summary collapse

Class Method Details

.install! ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/archunit/testing/rspec_adapter.rb', line 47

def install!
  return unless rspec_available?
  return if installed?

  ::RSpec::Matchers.include(RSpecMatchers)
  @installed = true
  nil
end

.installed? ⇒ Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/archunit/testing/rspec_adapter.rb', line 56

def installed?
  @installed == true
end