Sha256: 21e44e5e34765b36e799a3535bbc503ad4d62292996e7c79e085194bfc6ed627
Contents?: true
Size: 760 Bytes
Versions: 2
Compression:
Stored size: 760 Bytes
Contents
module Outpost module Expectations # Module containing response_code logic. It is the simplest of all, # it is a simple direct equality check. Extend your Scout to win instant # response_code checking. module ResponseCode # Installs the response code expectation def self.extended(base) base.expect :response_code, base.method(:evaluate_response_code) end # Method that will be used as an expectation to evaluate response code def evaluate_response_code(scout, response_code) if response_code.is_a?(Array) || response_code.is_a?(Range) response_code.include?(scout.response_code) else scout.response_code == response_code.to_i end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
outpost-0.2.5 | lib/outpost/expectations/response_code.rb |
outpost-0.2.4 | lib/outpost/expectations/response_code.rb |