Top Level Namespace

Defined Under Namespace

Modules: Punchblock, RSpecRayo

Instance Method Summary collapse

Instance Method Details

#match_type(object, type) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/rspec-rayo/matchers.rb', line 3

def match_type(object, type)
  unless object.is_a?(type)
    @error = "expected reason to be #{type}, got #{object}"
    raise RSpec::Expectations::ExpectationNotMetError
  end

  yield if block_given?

  object unless @error
end