github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

sneakin / spec_matcher_helper

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • master ✓
    • with_matchers
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Makes creating RSpec Matchers easier. — Read more

  cancel

http://nolan.eakins.net/node/311

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Added a small example to the doc string. 
sneakin (author)
Sun Jun 29 20:17:47 -0700 2008
commit  7d8fc6f430f5a7cb50d4491a78738cef51f8a950
tree    582346537c922603e98aeeb6089207008dcacf01
parent  94b895e78d3cbad8df9bae210cfb815a2ed5e5e5
spec_matcher_helper /
name age
history
message
file README Loading commit data...
file Rakefile
directory lib/
directory spec/
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
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server