public
Description: Makes creating RSpec Matchers easier.
Homepage: http://nolan.eakins.net/node/311
Clone URL: git://github.com/sneakin/spec_matcher_helper.git
name age message
file README Sun Jun 29 19:36:46 -0700 2008 Renamed `defmatcher` to `matcher`. Refactored i... [sneakin]
file Rakefile Sun Jun 29 20:11:53 -0700 2008 Added a Gem generation task. [sneakin]
directory lib/ Sun Jun 29 20:17:47 -0700 2008 Added a small example to the doc string. [sneakin]
directory spec/ Sun Jun 29 20:01:58 -0700 2008 Dropped back down to the basic method. RSpec wa... [sneakin]
README
RSpec Matcher Helper
=====================

Created by Nolan Eakins <nolan@eakins.net>
This library is in the public domain.

An Example
===========

matcher :inherits_from do
  def initialize(expecting)
    @expecting = expecting
  end

  def matches?(target)
    target == @expecting
  end
end

matcher :match_five => :inherits_from do
  def initialize  #:nodoc:all
    super(5)
  end
end

describe Something do
  it "uses the matcher" do
    (2 + 2).should_not match_five
  end
end