class ArgumentSpecification::Matchers::BeA

Attributes

expected[R]

Public Class Methods

new(expected) click to toggle source

Create a new matcher instance

Arguments:

expected: (Class)

Example:

>> ArgumentSpecification::Matchers::BeA.new(Symbol)
=> #<ArgumentSpecification::Matchers::BeA:0x00000000000000 @expected=Symbol>
# File lib/argspec/matchers/be_a.rb, line 17
def initialize(expected)
  @expected = expected
end

Public Instance Methods

matches?() click to toggle source

Check if the actual object matches

Example:

>> matcher.matches?
=> true
# File lib/argspec/matchers/be_a.rb, line 27
def matches?
  @actual.is_a?(@expected)
end