Sha256: e5395d5e785054f48523d95c6976bb98f48611a3fe3b890c795461a6da2cd854

Contents?: true

Size: 522 Bytes

Versions: 7

Compression:

Stored size: 522 Bytes

Contents

module RSpec
  module Matchers
    class BeAnInstanceOf
      include BaseMatcher

      def matches?(actual)
        super(actual).instance_of?(expected)
      end
    end

    # Passes if actual.instance_of?(expected)
    #
    # @example
    #
    #   5.should be_instance_of(Fixnum)
    #   5.should_not be_instance_of(Numeric)
    #   5.should_not be_instance_of(Float)
    def be_an_instance_of(expected)
      BeAnInstanceOf.new(expected)
    end
    
    alias_method :be_instance_of, :be_an_instance_of
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.8.0/lib/rspec/matchers/be_instance_of.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.8.0/lib/rspec/matchers/be_instance_of.rb
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-expectations-2.8.0/lib/rspec/matchers/be_instance_of.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-expectations-2.8.0/lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.8.0 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.8.0.rc2 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.8.0.rc1 lib/rspec/matchers/be_instance_of.rb