public
Description: An RSpec matcher for the Fakeweb HTTP stubbing library
Homepage:
Clone URL: git://github.com/freelancing-god/fakeweb-matcher.git
name age message
file .gitignore Wed Jul 29 07:23:49 -0700 2009 1.0 release [freelancing-god]
file LICENSE Thu Jul 16 15:25:59 -0700 2009 Initial commit to fakeweb-matcher. [freelancing-god]
file README.textile Sun Dec 06 04:36:03 -0800 2009 Adding Thilo to (the new) contributors list, an... [freelancing-god]
file Rakefile Wed Jul 29 07:23:49 -0700 2009 1.0 release [freelancing-god]
file VERSION.yml Sun Dec 06 04:36:32 -0800 2009 Updating version to 1.1.0 [freelancing-god]
file fakeweb-matcher.gemspec Sun Dec 06 04:36:32 -0800 2009 Updating version to 1.1.0 [freelancing-god]
directory lib/ Sun Dec 06 04:36:03 -0800 2009 Adding Thilo to (the new) contributors list, an... [freelancing-god]
directory spec/ Mon Nov 30 07:29:26 -0800 2009 Added support for regular expressions in expect... [thilo]
directory tasks/ Wed Jul 29 07:23:49 -0700 2009 1.0 release [freelancing-god]
README.textile

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.

Installing

First, install the gem

gem install fakeweb-matcher --source http://gemcutter.org

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.

Usage

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

Contribution

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.

Contributors

Copyright

Copyright © 2009 Pat Allan, released under an MIT Licence