Class: Stringup::Assertion

Inherits:
Object
  • Object
show all
Extended by:
Enumerable
Defined in:
lib/stringup/assertion.rb

Direct Known Subclasses

FileAssertion

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.[](name) ⇒ Object



9
10
11
# File 'lib/stringup/assertion.rb', line 9

def self.[](name)
  registry[name]
end

.assertion(name) ⇒ Object



17
18
19
# File 'lib/stringup/assertion.rb', line 17

def self.assertion(name)
  Assertion.registry[name.to_sym] = self
end

.each(&block) ⇒ Object



5
6
7
# File 'lib/stringup/assertion.rb', line 5

def self.each(&block)
  registry.each(&block)
end

.registryObject



13
14
15
# File 'lib/stringup/assertion.rb', line 13

def self.registry
  @registry ||= {}
end

Instance Method Details

#describe_should_at(event) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/stringup/assertion.rb', line 21

def describe_should_at(event)
  case event
  when :before
    raise NotImplementedError, "Assertion does not describe pre-puppet check"
  when :after
    raise NotImplementedError, "Assertion does not describe post-puppet check"
  else
    raise ArgumentError, "Unknown event #{event.inspect}"
  end
end