Module: AppTester::Checker Abstract
Overview
This module is abstract.
Check module to be used within a test snippet. This can be extended to have more checks
Instance Method Summary collapse
-
#status(response, overwrite_output = nil, fail = false) ⇒ NilClass
Check the status of a response and output to cmd.
Instance Method Details
#status(response, overwrite_output = nil, fail = false) ⇒ NilClass
Check the status of a response and output to cmd
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/app-tester/checker.rb', line 13 def status(response, overwrite_output=nil, fail=false) if response.status == 200 if overwrite_output.nil? puts "#{AppTester::Utils::Strings::SUCCESS} got status #{response.status}" else puts "#{AppTester::Utils::Strings::SUCCESS} #{overwrite_output}" end else if overwrite_output.nil? puts "#{AppTester::Utils::Strings::WARNING} got status #{response.status}" else puts "#{AppTester::Utils::Strings::WARNING} #{overwrite_output}" end exit(1) if fail end end |