Method: Typhoeus.stub
- Defined in:
- lib/typhoeus.rb
.stub(base_url, options = {}, &block) ⇒ Typhoeus::Expectation
Stub out a specific request.
90 91 92 93 94 95 96 97 98 99 |
# File 'lib/typhoeus.rb', line 90 def self.stub(base_url, = {}, &block) expectation = Expectation.all.find{ |e| e.base_url == base_url && e. == } if expectation.nil? expectation = Expectation.new(base_url, ) Expectation.all << expectation end expectation.and_return(&block) unless block.nil? expectation end |