Class: Reeve::Testing::Checks::Base
- Inherits:
-
Object
- Object
- Reeve::Testing::Checks::Base
- Defined in:
- lib/reeve/testing/checks/base.rb
Overview
What every check shares: a tool, a way to invoke it, a window onto the ledger, and the vocabulary its failure messages are written in.
Plain Ruby, deliberately. Nothing under checks/ may reference RSpec or Minitest, because the whole point of this layer is that a rake task, a deploy gate or a boot-time assertion can run it with neither framework installed (FR-026).
Direct Known Subclasses
AuditCoverage, ContractVersion, CrossPrincipalLeak, GuardDeclared, PrincipalRequired, RedactionHolds, RulePresent
Defined Under Namespace
Classes: Attempt
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
- #check_name ⇒ Object
-
#initialize(tool: nil, arguments: {}, invoke: nil, ledger: nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(tool: nil, arguments: {}, invoke: nil, ledger: nil) ⇒ Base
Returns a new instance of Base.
34 35 36 37 38 39 |
# File 'lib/reeve/testing/checks/base.rb', line 34 def initialize(tool: nil, arguments: {}, invoke: nil, ledger: nil) @tool = tool @arguments = arguments @invoke = invoke || Reeve.method(:invoke) @ledger = ledger || Ledger.default end |
Class Method Details
.check_name ⇒ Object
30 31 32 |
# File 'lib/reeve/testing/checks/base.rb', line 30 def self.check_name name.to_s.split("::").last end |
Instance Method Details
#call ⇒ Object
41 42 43 |
# File 'lib/reeve/testing/checks/base.rb', line 41 def call raise NotImplementedError, "#{self.class} must implement #call" end |
#check_name ⇒ Object
45 46 47 |
# File 'lib/reeve/testing/checks/base.rb', line 45 def check_name self.class.check_name end |