Class: Heroku::Kensa::DeprovisionCheck
- Includes:
- HTTP
- Defined in:
- lib/heroku/kensa/check.rb
Instance Attribute Summary
Attributes inherited from Check
Instance Method Summary collapse
Methods included from HTTP
#delete, #get, #post, #put, #request
Methods inherited from ApiCheck
#base_path, #credentials, #heroku_id
Methods inherited from Check
#call, #check, #env, #error, #initialize, #run, #test, #to_proc, #url
Constructor Details
This class inherits a constructor from Heroku::Kensa::Check
Instance Method Details
#call! ⇒ Object
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
# File 'lib/heroku/kensa/check.rb', line 360 def call! id = data[:id] raise ArgumentError, "No id specified" if id.nil? path = "#{base_path}/#{CGI::escape(id.to_s)}" test "DELETE #{path}" check "response" do code, _ = delete(credentials, path, nil) if code == 200 true elsif code == -1 error("unable to connect to #{url}") else error("expected 200, got #{code}") end end check "authentication" do wrong_credentials = ['wrong', 'secret'] code, _ = delete(wrong_credentials, path, nil) error("expected 401, got #{code}") if code != 401 true end end |