Sha256: 4058b4cc5b15ca1f0fdd97e7d5299d4f09e5cef144160e8e517e248f528e6e22

Contents?: true

Size: 697 Bytes

Versions: 56

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

56 entries across 56 versions & 6 rubygems

Version Path
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb
nutshell-crm-0.0.5 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb
nutshell-crm-0.0.4 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb
nutshell-crm-0.0.3 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb
nutshell-crm-0.0.2 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb
nutshell-crm-0.0.1 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.7.0 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.7.0.rc1 lib/rspec/matchers/be_instance_of.rb
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/rspec-expectations-2.5.0/lib/rspec/matchers/be_instance_of.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/rspec-expectations-2.5.0/lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.6.0 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.6.0.rc6 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.6.0.rc4 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.6.0.rc2 lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.5.0 lib/rspec/matchers/be_instance_of.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/lib/rspec/matchers/be_instance_of.rb
rspec-expectations-2.4.0 lib/rspec/matchers/be_instance_of.rb