Skip to content
An RSpec matcher for the Fakeweb HTTP stubbing library
Latest commit 243e644 Dec 28, 2014 @pat Stick with RSpec 2.6.


FakeWeb Matcher

An RSpec matcher for the Fakeweb HTTP stubbing library, allowing you to use RSpec syntax to check if requests to particular URIs have been made.


First, install the gem

gem install fakeweb-matcher --source

Then, in your spec/spec_helper.rb file, you’ll need to require the library after you have required FakeWeb and RSpec. It should end up looking something like this:

require 'spec'
require 'fakeweb'
require 'fakeweb_matcher'

This ensures that the matcher is automatically loaded into RSpec for you.


FakeWeb.should have_requested(:get, '')
FakeWeb.should have_requested(:any, '')
FakeWeb.should have_requested(:post, /http:\/\/\/)
FakeWeb.should_not have_requested(:put, '')


Unsurprisingly, this library is tested using RSpec, and relies upon FakeWeb. It also uses YARD for documentation, so if you’re submitting patches (which are most definitely welcome!) please use YARD syntax and have valid specs.



Copyright © 2009 Pat Allan, released under an MIT Licence

Something went wrong with that request. Please try again.