1
require File.dirname(__FILE__) + '/../../spec_helper'
6
def can_swim?(distance_in_yards)
7
distance_in_yards < 1000
11
describe "predicate_matcher[method_on_object] = matcher_method" do
12
predicate_matchers[:swim] = :can_swim?
13
it "should match matcher_method if method_on_object returns true" do
14
swim(100).matches?(Fish.new).should be_true
16
it "should not match matcher_method if method_on_object returns false" do
17
swim(10000).matches?(Fish.new).should be_false