Class: APIMatchers::HTTPStatusCode::BeUnauthorized

Inherits:
Base
  • Object
show all
Defined in:
lib/api_matchers/http_status_code/be_unauthorized.rb

Instance Attribute Summary

Attributes inherited from Base

#setup

Instance Method Summary collapse

Methods inherited from Base

#find_http_status_code, #initialize, #matches?

Constructor Details

This class inherits a constructor from APIMatchers::HTTPStatusCode::Base

Instance Method Details

#expected_status_codeObject



4
5
6
# File 'lib/api_matchers/http_status_code/be_unauthorized.rb', line 4

def expected_status_code
  401
end

#failure_messageObject Also known as: failure_message_for_should



8
9
10
# File 'lib/api_matchers/http_status_code/be_unauthorized.rb', line 8

def failure_message
  %Q{expected that '#{@http_status_code}' to be Unauthorized with the status '401'.}
end

#failure_message_when_negatedObject Also known as: failure_message_for_should_not



12
13
14
# File 'lib/api_matchers/http_status_code/be_unauthorized.rb', line 12

def failure_message_when_negated
  %Q{expected that '#{@http_status_code}' to NOT be Unauthorized.}
end