lib/sinatra/export.rb
def handle_error_incorrect_status!(path, expected: nil,actual: nil)
          # These argument checks are for Ruby v2.0 as it
          # doesn't support required keyword args.
          fail ArgumentError, "'expected' is a required argument to handle_error_incorrect_status!" if expected.nil?
          fail ArgumentError, "'actual' is a required argument to handle_error_incorrect_status!" if actual.nil?

          desc = "GET #{path} returned #{actual} status code instead of #{expected}"
          @error_handler.call(desc)
          status_error desc
        end
# Handles the error caused by a mismatch in status code expectations.
# @param [String] path The route path.
# @param [#to_s] expected The status code that was expected.
# @param [#to_s] actual The actual status code received.
Handles the error caused by a mismatch in status code expectations.
Handles the error caused by a mismatch in status code expectations .
def handle_error_incorrect_status!(path, expected: nil,actual: nil)
          fail ArgumentError, "'expected' is a required argument to handle_error_incorrect_status!" if expected.nil?
          fail ArgumentError, "'actual' is a required argument to handle_error_incorrect_status!" if actual.nil?
          desc = "GET #{path} returned #{actual} status code instead of #{expected}"
          @error_handler.call(desc)
          status_error desc
        end
def handle_error_incorrect_status! ( path , expected : nil , actual : nil ) fail ArgumentError , "'expected' is a required argument to handle_error_incorrect_status!" if expected . nil? fail ArgumentError , "'actual' is a required argument to handle_error_incorrect_status!" if actual . nil? desc = "GET #{path} returned #{actual} status code instead of #{expected}" @error_handler . call ( desc ) status_error desc end
Handles the error caused by a mismatch in status code expectations.
Handles the error caused by a mismatch in status code expectations .
# These argument checks are for Ruby v2.0 as it # doesn't support required keyword args.
path
expected
actual
actual The actual status code received.
actual The actual status code received .