Repository is archived
No commit activity in last 3 years
No release in over 3 years
RSpec matcher for the FakeWeb library
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.2.5
>= 1.2.0
 Project Readme

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