Sha256: c749927b469ee9dea372e583380ee8880a2a657e05396ccbf7d0ff1e82f9641a

Contents?: true

Size: 1.42 KB

Versions: 5

Compression:

Stored size: 1.42 KB

Contents

h1. 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.

h2. Installing

First, install the gem
<pre><code>gem install fakeweb-matcher --source http://gemcutter.org</code></pre>

Then, in your @spec/spec_helper.rb@ file, you'll need to require the library _after_ you have required "FakeWeb":http://fakeweb.rubyforge.org and "RSpec":http://rspec.info. It should end up looking something like this:

<pre><code>require 'spec'
require 'fakeweb'
require 'fakeweb_matcher'</code></pre>

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

h2. Usage

<pre><code>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')</code></pre>

h2. Contribution

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

h2. Contributors

* "Thilo Utke":http://github.com/thilo (Regex URL matching)
* "Wes Morgan":http://nerdyadventuresofwes.blogspot.com/ (Normalise query params)

h2. Copyright

Copyright (c) 2009 Pat Allan, released under an MIT Licence

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fakeweb-matcher-1.2.4 README.textile
fakeweb-matcher-1.2.3 README.textile
fakeweb-matcher-1.2.2 README.textile
fakeweb-matcher-1.2.1 README.textile
fakeweb-matcher-1.2.0 README.textile