Sha256: bbf09ab6ab84a4dc410b622083b2b9eb0ea21cd8648ed810f27afadc7c0e3e5c

Contents?: true

Size: 606 Bytes

Versions: 8

Compression:

Stored size: 606 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 & 3 rubygems

Version Path
deckshuffler-0.0.2 vendor/plugins/rspec/spec/spec/dsl/predicate_matcher_spec.rb
has_finder-0.1.2 spec/rails/vendor/plugins/rspec/spec/spec/dsl/predicate_matcher_spec.rb
has_finder-0.1.1 spec/rails/vendor/plugins/rspec/spec/spec/dsl/predicate_matcher_spec.rb
has_finder-0.1.3 spec/rails/vendor/plugins/rspec/spec/spec/dsl/predicate_matcher_spec.rb
rspec-1.0.5 spec/spec/dsl/predicate_matcher_spec.rb
rspec-1.0.8 spec/spec/dsl/predicate_matcher_spec.rb
rspec-1.0.6 spec/spec/dsl/predicate_matcher_spec.rb
rspec-1.0.7 spec/spec/dsl/predicate_matcher_spec.rb