File: challenge.rb

package info (click to toggle)
ruby-rack-test 0.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 348 kB
  • ctags: 142
  • sloc: ruby: 1,713; makefile: 3
file content (11 lines) | stat: -rw-r--r-- 268 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
RSpec::Matchers.define :be_challenge do
  match do |actual_response|
    actual_response.status == 401 &&
    actual_response['WWW-Authenticate'] =~ /^Digest / &&
    actual_response.body.empty?
  end

  description do
    "a HTTP Digest challenge response"
  end
end