Module: StubRequests

Extended by:
StubRequests, UriFor
Includes:
API, UriFor
Included in:
StubRequests
Defined in:
lib/stub_requests/api.rb,
lib/stub_requests/dsl.rb,
lib/stub_requests/uri.rb,
lib/stub_requests/service.rb,
lib/stub_requests/version.rb,
lib/stub_requests/callback.rb,
lib/stub_requests/endpoint.rb,
lib/stub_requests/exceptions.rb,
lib/stub_requests/uri/scheme.rb,
lib/stub_requests/uri/suffix.rb,
lib/stub_requests/uri/builder.rb,
lib/stub_requests/utils/fuzzy.rb,
lib/stub_requests/request_stub.rb,
lib/stub_requests/configuration.rb,
lib/stub_requests/stub_registry.rb,
lib/stub_requests/stub_requests.rb,
lib/stub_requests/uri/validator.rb,
lib/stub_requests/webmock/builder.rb,
lib/stub_requests/service_registry.rb,
lib/stub_requests/callback_registry.rb,
lib/stub_requests/concerns/property.rb,
lib/stub_requests/dsl/define_method.rb,
lib/stub_requests/endpoint_registry.rb,
lib/stub_requests/dsl/method_definition.rb,
lib/stub_requests/concerns/register_verb.rb,
lib/stub_requests/concerns/property/validator.rb,
lib/stub_requests/concerns/argument_validation.rb,
lib/stub_requests/webmock/stub_registry_extension.rb

Overview

Abstraction over WebMock to reduce duplication

Author:

Since:

  • 0.1.0

Defined Under Namespace

Modules: API, Concerns, URI, Utils, WebMock Classes: Callback, CallbackRegistry, Configuration, DSL, Endpoint, EndpointNotFound, EndpointRegistry, Error, InvalidArgumentType, InvalidCallback, InvalidUri, PropertyDefined, RequestStub, Service, ServiceNotFound, ServiceRegistry, StubRegistry, UriSegmentMismatch

Constant Summary collapse

VERSION =

Returns a version string

Returns:

  • (String)

    a version string

Since:

  • 0.1.0

"0.1.11"

Instance Method Summary collapse

Methods included from API

#__stub_endpoint, #define_stubs, included, #print_stubs, #register_callback, #register_service, #stub_endpoint, #unregister_callback

Instance Method Details

#configConfiguration

Contains gem configuration

Returns:

Since:

  • 0.1.0



44
45
46
# File 'lib/stub_requests/stub_requests.rb', line 44

def config
  @config ||= Configuration.new
end

#configure {|config| ... } ⇒ Configuration

Allows the gem to be configured

Yield Parameters:

Yield Returns:

  • (<type>)

Returns:

Since:

  • 0.1.0



33
34
35
36
# File 'lib/stub_requests/stub_requests.rb', line 33

def configure
  yield(config) if block_given?
  config
end

#loggerObject

Since:

  • 0.1.0



48
49
50
# File 'lib/stub_requests/stub_requests.rb', line 48

def logger
  config.logger
end

#logger=(obj) ⇒ Object

Since:

  • 0.1.0



52
53
54
# File 'lib/stub_requests/stub_requests.rb', line 52

def logger=(obj)
  config.logger = obj
end

#versionString

The current version of the gem

Returns:

  • (String)

    version string, "1.0.0"

Since:

  • 0.1.0



62
63
64
# File 'lib/stub_requests/stub_requests.rb', line 62

def version
  VERSION
end