Class: ApiPi::Case
Instance Attribute Summary collapse
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, tests) ⇒ Case
constructor
A new instance of Case.
-
#investigate ⇒ Object
Begin investigating each GET request and their tests.
Constructor Details
#initialize(url, tests) ⇒ Case
Returns a new instance of Case.
5 6 7 8 9 10 |
# File 'lib/api_pi/case.rb', line 5 def initialize(url, tests) @tests = tests @url = url @success_count = 0 @failure_count = 0 end |
Instance Attribute Details
#tests ⇒ Object (readonly)
Returns the value of attribute tests.
4 5 6 |
# File 'lib/api_pi/case.rb', line 4 def tests @tests end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/api_pi/case.rb', line 4 def url @url end |
Instance Method Details
#investigate ⇒ Object
Begin investigating each GET request and their tests.
14 15 16 17 18 19 20 21 22 |
# File 'lib/api_pi/case.rb', line 14 def investigate puts "\nRequesting JSON from #{url} and testing" tests.each_pair do |test, block| print " - #{test}\n" check test, block end summary exit_status end |