Sha256: 26ff40b7af8b7a98e4b39af8ca48acfbc0e9f5887b889e1cab5f2fb60b30b1dc

Contents?: true

Size: 697 Bytes

Versions: 18

Compression:

Stored size: 697 Bytes

Contents

module Rspec
  module Matchers
    # :call-seq:
    #   should be_instance_of(expected)
    #   should be_an_instance_of(expected)
    #   should_not be_instance_of(expected)
    #   should_not be_an_instance_of(expected)
    #
    # Passes if actual.instance_of?(expected)
    #
    # == Examples
    #
    #   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)
      Matcher.new :be_an_instance_of, expected do |_expected_|
        match do |actual|
          actual.instance_of?(_expected_)
        end
      end
    end
    
    alias_method :be_instance_of, :be_an_instance_of
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rspec-expectations-2.0.0.beta.8 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.beta.7 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.beta.6 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.beta.5 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.beta.4 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.beta.3 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.beta.2 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.beta.1 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.a10 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.a9 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.a8 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.a7 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.a6 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.a5 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.a4 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.a3 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.a2 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.0.0.a1 lib/rspec/matchers/be_instance_of.rb