Sha256: b77e81f3fa420969965201cf794d3f2e81fa6356af902780eb23e4730bb39938
Contents?: true
Size: 783 Bytes
Versions: 7
Compression:
Stored size: 783 Bytes
Contents
module APIMatchers module HTTPStatusCode class Base attr_reader :setup def initialize(setup) @setup = setup end # Matches the actual with the expected http status code # def matches?(actual) @http_status_code = find_http_status_code(actual) @http_status_code.equal?(expected_status_code) end def expected_status_code raise NotImplementedError, "not implemented on #{self}" end # If have some configuration about the method to call on actual that method will be called. # def find_http_status_code(actual) if @setup.http_status_method.present? actual.send(@setup.http_status_method) else actual end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems