Sha256: 041a0302b46d2eaaa78e16a907c031e9674c6a2e5bef12faf1dbaf148fc36232

Contents?: true

Size: 636 Bytes

Versions: 56

Compression:

Stored size: 636 Bytes

Contents

module RSpec
  module Matchers
    # :call-seq:
    #   should be_kind_of(expected)
    #   should be_a_kind_of(expected)
    #   should_not be_kind_of(expected)
    #   should_not be_a_kind_of(expected)
    #
    # Passes if actual.kind_of?(expected)
    #
    # == Examples
    #
    #   5.should be_kind_of(Fixnum)
    #   5.should be_kind_of(Numeric)
    #   5.should_not be_kind_of(Float)
    def be_a_kind_of(expected)
      Matcher.new :be_a_kind_of, expected do |_expected_|
        match do |actual|
          actual.kind_of?(_expected_)
        end
      end
    end
    
    alias_method :be_kind_of, :be_a_kind_of
  end
end

Version data entries

56 entries across 56 versions & 6 rubygems

Version Path
gemrage-0.0.0 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.rc lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.22 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.20 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.19 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.18 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.17 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.16 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.15 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.14 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.13 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.12 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.11 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.10 lib/rspec/matchers/be_kind_of.rb
rspec-expectations-2.0.0.beta.9 lib/rspec/matchers/be_kind_of.rb