Method: Conify::Test#run

Defined in:
lib/conify/test.rb

#run(klass, data) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/conify/test.rb', line 21

def run(klass, data)
  test_name = klass.to_s.gsub('Conify::', '').split(/(?=[A-Z])/).join(' ')

  begin
    klass.new(data).call
  rescue Exception => e
    error "#{test_name} #{e.message}"
  end

  if klass.const_defined?('OUTPUT_COMPLETION') && klass.const_get('OUTPUT_COMPLETION')
    display "#{test_name}: Looks good..."
  end
end