Sha256: 36917a3f8081c8a11e4d0076c21d33d4caadd020e8ec23ebfc79ed50b21a0d77

Contents?: true

Size: 490 Bytes

Versions: 13

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true
RSpec::Matchers.define :be_successful do
  match do |actual|
    next true if proxy_rb.config.strict == false && (actual.status_code.nil? || actual.status_code == 0)

    sleep 0.5
    actual.status_code.to_s.start_with?('2', '3')
  end

  failure_message do |actual|
    %(expected that response has status code 2xx, but has #{actual.status_code})
  end

  failure_message_when_negated do
    %(expected that response does not have status code 2xx)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
proxy_rb-0.10.4 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.10.3 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.10.2 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.10.1 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.10.0 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.9.3 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.9.2 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.9.1 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.9.0 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.8.3 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.8.2 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.8.1 lib/proxy_rb/matchers/be_successful.rb
proxy_rb-0.8.0 lib/proxy_rb/matchers/be_successful.rb