Class: Spec::Mocks::ArgumentConstraints::InstanceOf

Inherits:
Object
  • Object
show all
Defined in:
lib/gems/rspec-1.1.12/lib/spec/mocks/argument_constraints.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ InstanceOf

Returns a new instance of InstanceOf.



126
127
128
# File 'lib/gems/rspec-1.1.12/lib/spec/mocks/argument_constraints.rb', line 126

def initialize(klass)
  @klass = klass
end

Instance Method Details

#==(actual) ⇒ Object



130
131
132
# File 'lib/gems/rspec-1.1.12/lib/spec/mocks/argument_constraints.rb', line 130

def ==(actual)
  actual.instance_of?(@klass)
end