Module: ObjectiveCommand::Runners::Mockable

Included in:
Runner
Defined in:
lib/objective_command/runners/mockable.rb

Instance Method Summary collapse

Instance Method Details

#make_mock(log = [], &block) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/objective_command/runners/mockable.rb', line 12

def make_mock log=[], &block
  @log   = log
  @block = block

  class << self
    attr_accessor :log
    attr_accessor :block

    def exec ( aCommand, aData )
      @block[aCommand, aData]
    end

    def display_command ( m )
      @log << m
    end
  end # class << self

  self
end