Sha256: 975a94b123969c22f7ba699f1e730b1e1283f4c48da6643def59da4e891689be

Contents?: true

Size: 610 Bytes

Versions: 85

Compression:

Stored size: 610 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

module Spec
  module Example
    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

85 entries across 85 versions & 12 rubygems

Version Path
dchelimsky-rspec-1.1.10 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.11.1 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.11.2 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.11.3 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.11.4 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.11.5 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.11.6 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.11.7 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.11 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.12 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.99.1 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.99.13 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.99.2 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.99.3 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.99.4 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.99.5 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.99.6 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.99.7 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.99.8 spec/spec/example/predicate_matcher_spec.rb
dchelimsky-rspec-1.1.99.9 spec/spec/example/predicate_matcher_spec.rb