Module: ServiceDouble
- Defined in:
- lib/service_double.rb,
lib/service_double/manager.rb,
lib/service_double/version.rb,
lib/service_double/configuration.rb
Defined Under Namespace
Classes: Configuration, Manager
Constant Summary
collapse
- Error =
Class.new(StandardError)
- UnknownFramework =
Class.new(Error)
- NotRunning =
Class.new(Error)
- NotStarted =
Class.new(Error)
- Timeout =
Class.new(Error)
- VERSION =
"0.0.3"
- NoURLSet =
Class.new(Error)
- NoServerSet =
Class.new(Error)
- ServerNotFound =
Class.new(Error)
Class Method Summary
collapse
Class Method Details
.hook_into(framework, &block) ⇒ Object
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/service_double.rb', line 11
def self.hook_into(framework, &block)
require_relative "service_double/frameworks/#{framework}"
config = Configuration.new
yield config
manager = Manager.new(config)
managers << manager
manager
rescue LoadError
raise UnknownFramework, "No hooks provided for #{framework.inspect}."
end
|
.managers ⇒ Object
22
23
24
|
# File 'lib/service_double.rb', line 22
def self.managers
@managers ||= []
end
|
.reset ⇒ Object
34
35
36
|
# File 'lib/service_double.rb', line 34
def self.reset
managers.each(&:reset)
end
|
.start ⇒ Object
26
27
28
|
# File 'lib/service_double.rb', line 26
def self.start
managers.each(&:start)
end
|
.stop ⇒ Object
30
31
32
|
# File 'lib/service_double.rb', line 30
def self.stop
managers.each(&:stop)
end
|