Sha256: d8540443883bea22036ec0e6d134c1463ed8deeaa501b7329a3dacc749579b7f
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
require "rspec" require "rack/test" require "rack/throttle" require "timecop" unless RUBY_VERSION.match(/1\.8/) require 'simplecov' SimpleCov.start end def example_target_app @target_app = double("Example Rack App") allow(@target_app).to receive(:call).with(any_args()).and_return([200, {}, "Example App Body"]) @target_app end RSpec::Matchers.define :show_allowed_response do match do |body| body.include?("Example App Body") end failure_message do "expected response to show the allowed response" end failure_message_when_negated do "expected response not to show the allowed response" end description do "expected the allowed response" end end RSpec::Matchers.define :show_throttled_response do match do |body| body.include?("Rate Limit Exceeded") end failure_message do "expected response to show the throttled response" end failure_message do "expected response not to show the throttled response" end description do "expected the throttled response" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
improved-rack-throttle-0.9.0 | spec/spec_helper.rb |
improved-rack-throttle-0.8.0 | spec/spec_helper.rb |