Class: BetterReceive::Stub

Inherits:
Base
  • Object
show all
Defined in:
lib/better_receive/stub.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from BetterReceive::Base

Instance Method Details

#assert_with(selector_or_hash, options = {}, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/better_receive/stub.rb', line 4

def assert_with(selector_or_hash, options={}, &block)
  if selector_or_hash.is_a?(Hash)
    selector_or_hash.each do |selector, value|
      better_stub_method(selector, options, &block).and_return(value)
    end
  else
    better_stub_method(selector_or_hash, options, &block)
  end
end