Sha256: 4aad97ce72b5fad7265e6c390bcd357afef17ee36fd0665ad28fed8f6e9ddb5f

Contents?: true

Size: 696 Bytes

Versions: 36

Compression:

Stored size: 696 Bytes

Contents

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

36 entries across 36 versions & 11 rubygems

Version Path
rspec-instructure-1.3.3 lib/spec/matchers/be_instance_of.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-1.3.2/lib/spec/matchers/be_instance_of.rb
rspec-1.3.2 lib/spec/matchers/be_instance_of.rb
rspec-1.3.1 lib/spec/matchers/be_instance_of.rb
rspec-1.3.1.rc lib/spec/matchers/be_instance_of.rb
rspec-1.3.0 lib/spec/matchers/be_instance_of.rb
hubbub-0.0.11 lib/vendor/plugins/rspec/lib/spec/matchers/be_instance_of.rb
hubbub-0.0.10 lib/vendor/plugins/rspec/lib/spec/matchers/be_instance_of.rb
hubbub-0.0.9 lib/vendor/plugins/rspec/lib/spec/matchers/be_instance_of.rb
hubbub-0.0.8 lib/vendor/plugins/rspec/lib/spec/matchers/be_instance_of.rb
hubbub-0.0.6 lib/vendor/plugins/rspec/lib/spec/matchers/be_instance_of.rb
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/lib/spec/matchers/be_instance_of.rb
media-path-0.1.2 vendor/rspec/lib/spec/matchers/be_instance_of.rb
simple-templater-0.0.1.3 vendor/rspec/lib/spec/matchers/be_instance_of.rb
pupu-0.0.2.pre vendor/rspec/lib/spec/matchers/be_instance_of.rb
media-path-0.1.1.pre vendor/rspec/lib/spec/matchers/be_instance_of.rb
simple-templater-0.0.1.2 vendor/rspec/lib/spec/matchers/be_instance_of.rb
media-path-0.1.1 vendor/rspec/lib/spec/matchers/be_instance_of.rb
simple-templater-0.0.1.1 vendor/rspec/lib/spec/matchers/be_instance_of.rb
pupu-0.0.2 vendor/rspec/lib/spec/matchers/be_instance_of.rb