Sha256: 676806e7e19ef67788fdf8a701b2a2ab8db286efd49d59bb40a1027ce7413467
Contents?: true
Size: 594 Bytes
Versions: 14
Compression:
Stored size: 594 Bytes
Contents
require 'rspec/webservice_matchers/util' module RSpec module WebserviceMatchers module BeStatus # Pass when a URL returns the expected status code # Codes are defined in http://www.rfc-editor.org/rfc/rfc2616.txt RSpec::Matchers.define :be_status do |expected_code| actual_code = nil match do |url_or_domain_name| actual_code = Util.status(url_or_domain_name) actual_code == expected_code.to_i end failure_message do "Received status #{actual_code}" end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems