Module: Typhoeus::Hydra::Stubbing::SharedMethods
- Included in:
- Typhoeus::Hydra::Stubbing
- Defined in:
- lib/typhoeus/hydra/stubbing.rb
Class Method Summary collapse
Instance Method Summary collapse
- #clear_stubs ⇒ Object
- #find_stub_from_request(request) ⇒ Object
- #stub(method, url, options = {}) ⇒ Object
Class Method Details
.extended(base) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/typhoeus/hydra/stubbing.rb', line 18 def self.extended(base) class << base attr_accessor :stubs end base.stubs = [] end |
Instance Method Details
#clear_stubs ⇒ Object
10 11 12 |
# File 'lib/typhoeus/hydra/stubbing.rb', line 10 def clear_stubs self.stubs = [] end |
#find_stub_from_request(request) ⇒ Object
14 15 16 |
# File 'lib/typhoeus/hydra/stubbing.rb', line 14 def find_stub_from_request(request) stubs.detect { |stub| stub.matches?(request) } end |