Class: Reeve::Testing::Checks::GuardDeclared

Inherits:
Base
  • Object
show all
Defined in:
lib/reeve/testing/checks/guard_declared.rb

Overview

FR-002, FR-004: a tool with no guard_with is not neutral, it is denied. This is the check that tells you before production which of your tools that is.

Reeve::Checks::GuardDeclared.new(tool: InvoiceSearchTool).call

Instance Method Summary collapse

Methods inherited from Base

check_name, #check_name, #initialize

Constructor Details

This class inherits a constructor from Reeve::Testing::Checks::Base

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
# File 'lib/reeve/testing/checks/guard_declared.rb', line 11

def call
  guard = declaration
  return failure if guard.nil?

  passed(
    "#{tool_label} is guarded by #{guard.policy_name} (action: #{guard.action})",
    policy: guard.policy_name, action: guard.action
  )
end