Class: ArchUnit::Testing::RSpecPassMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/archunit/testing/rspec_adapter.rb

Overview

RSpec's matcher protocol, delegating all evaluation and prose to shared testing code.

Instance Method Summary collapse

Constructor Details

#initialize(options = nil) ⇒ RSpecPassMatcher

Returns a new instance of RSpecPassMatcher.



7
8
9
# File 'lib/archunit/testing/rspec_adapter.rb', line 7

def initialize(options = nil)
  @options = options
end

Instance Method Details

#does_not_match?(rule) ⇒ Boolean

RSpec's matcher protocol fixes this method name. rubocop:disable Naming/PredicatePrefix

Returns:

  • (Boolean)


17
18
19
# File 'lib/archunit/testing/rspec_adapter.rb', line 17

def does_not_match?(rule)
  matches_expectation?(rule, expected_to_pass: false)
end

#failure_messageObject Also known as: failure_message_when_negated

rubocop:enable Naming/PredicatePrefix



22
23
24
# File 'lib/archunit/testing/rspec_adapter.rb', line 22

def failure_message
  result.message
end

#matches?(rule) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/archunit/testing/rspec_adapter.rb', line 11

def matches?(rule)
  matches_expectation?(rule, expected_to_pass: true)
end