Sha256: 057d49c0484b7a76397987a2ef0d71d5f8000d88e559925465fa6f227472e50a
Contents?: true
Size: 605 Bytes
Versions: 8
Compression:
Stored size: 605 Bytes
Contents
require File.dirname(__FILE__) + '/../../spec_helper' module Spec module DSL class Fish def can_swim?(distance_in_yards) distance_in_yards < 1000 end end describe "predicate_matcher[method_on_object] = matcher_method" do predicate_matchers[:swim] = :can_swim? it "should match matcher_method if method_on_object returns true" do swim(100).matches?(Fish.new).should be_true end it "should not match matcher_method if method_on_object returns false" do swim(10000).matches?(Fish.new).should be_false end end end end
Version data entries
8 entries across 8 versions & 1 rubygems