Sha256: 9e940aa54cbea990dffe7ecc9be156708b91d3ad6f11b25608e273fe8cd6ed91

Contents?: true

Size: 337 Bytes

Versions: 2

Compression:

Stored size: 337 Bytes

Contents

class StubExecutor
  attr_reader :commands

  def initialize
    @responses = {}
    @commands = []
  end

  def invoke(command)
    @commands << command
    @responses.fetch(command, [["", 0]]).pop
  end

  def add_response(command, output, status)
    @responses[command] ||= []
    @responses[command].push [output, status]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
big_brother-0.4.1 spec/support/stub_executor.rb
big_brother-0.4.0 spec/support/stub_executor.rb