Class: ChefSpec::Stubs::Registry
- Inherits:
-
Object
- Object
- ChefSpec::Stubs::Registry
show all
- Extended by:
- Forwardable
- Includes:
- Singleton
- Defined in:
- lib/chefspec/stubs/registry.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Registry.
14
15
16
|
# File 'lib/chefspec/stubs/registry.rb', line 14
def initialize
reset!
end
|
Instance Attribute Details
#stubs ⇒ Hash<Symbol, Array<SearchStub>>
12
13
14
|
# File 'lib/chefspec/stubs/registry.rb', line 12
def stubs
@stubs
end
|
Instance Method Details
#register(stub) ⇒ Object
22
23
24
25
|
# File 'lib/chefspec/stubs/registry.rb', line 22
def register(stub)
@stubs.insert(0, stub)
stub
end
|
#reset! ⇒ Object
18
19
20
|
# File 'lib/chefspec/stubs/registry.rb', line 18
def reset!
@stubs = []
end
|
#stub_for(*args) ⇒ Object
27
28
29
|
# File 'lib/chefspec/stubs/registry.rb', line 27
def stub_for(*args)
raise ArgumentError, "#stub_for is an abstract function"
end
|