Sha256: 70166e718c52771598f607a4dfcccd122b4f49fceec7a10c2ff526fbffba3ac9

Contents?: true

Size: 513 Bytes

Versions: 2

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true
require 'rspec/webservice_matchers/util'

module RSpec
  module WebserviceMatchers
    module BeUp
      # Pass when the response code is 200, following redirects if necessary.
      RSpec::Matchers.define :be_up do
        status = nil

        match do |url_or_domain_name|
          status = Util.status(url_or_domain_name, follow: true)
          status == 200
        end

        failure_message do
          "Received status #{status}"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspec-webservice_matchers-4.7.0 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.6.0 lib/rspec/webservice_matchers/be_up.rb