Class: Kiel::SCM::Mock
- Inherits:
-
Object
- Object
- Kiel::SCM::Mock
- Defined in:
- lib/kiel/scm/mock.rb
Overview
A mock, implementing the interface to a source code managment system
Instance Method Summary collapse
-
#initialize(versions = {}) ⇒ Mock
constructor
A new instance of Mock.
-
#version(step) ⇒ Object
returns the latest version of the given file.
-
#versions(hash) ⇒ Object
–.
Constructor Details
#initialize(versions = {}) ⇒ Mock
Returns a new instance of Mock.
7 8 9 |
# File 'lib/kiel/scm/mock.rb', line 7 def initialize versions = {} @versions = versions end |
Instance Method Details
#version(step) ⇒ Object
returns the latest version of the given file
12 13 14 15 16 |
# File 'lib/kiel/scm/mock.rb', line 12 def version step step = step.to_s raise RuntimeError, "no mocked version for step \'#{step}\'" unless @versions.key? step @versions[ step ] end |
#versions(hash) ⇒ Object
–
19 20 21 |
# File 'lib/kiel/scm/mock.rb', line 19 def versions hash @versions = hash end |