Sha256: 17e15d462deb959cc44adfbf6eb94401ce8c1a6fcbdca4ba97272a8def2117be

Contents?: true

Size: 483 Bytes

Versions: 11

Compression:

Stored size: 483 Bytes

Contents

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

11 entries across 11 versions & 1 rubygems

Version Path
rspec-webservice_matchers-4.5.0 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.4.3 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.4.2 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.4.1 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.4.0 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.3.2 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.3.1 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.3.0 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.2.0 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.1.3 lib/rspec/webservice_matchers/be_up.rb
rspec-webservice_matchers-4.1.2 lib/rspec/webservice_matchers/be_up.rb