class WebStub::Registry

Public Class Methods

new() click to toggle source
# File lib/webstub/registry.rb, line 3
def initialize()
  @stubs = []
end

Public Instance Methods

add_stub(method, path) click to toggle source
# File lib/webstub/registry.rb, line 7
def add_stub(method, path)
  stub = Stub.new(method, path)
  @stubs << stub

  stub
end
reset() click to toggle source
# File lib/webstub/registry.rb, line 14
def reset
  @stubs = []
end
size() click to toggle source
# File lib/webstub/registry.rb, line 18
def size
  @stubs.size
end
stub_matching(method, url, options={}) click to toggle source
# File lib/webstub/registry.rb, line 22
def stub_matching(method, url, options={})
  @stubs.each do |stub|
    if stub.matches?(method, url, options)
      return stub
    end
  end

  nil
end