Class: Koine::TestRunner::Adapters::LastCommand

Inherits:
BaseAdapter
  • Object
show all
Defined in:
lib/koine/test_runner/adapters/last_command.rb

Defined Under Namespace

Classes: Storage

Instance Attribute Summary

Attributes inherited from BaseAdapter

#next_adapter

Instance Method Summary collapse

Constructor Details

#initialize(storage: Storage.new) ⇒ LastCommand



5
6
7
# File 'lib/koine/test_runner/adapters/last_command.rb', line 5

def initialize(storage: Storage.new)
  @storage = storage
end

Instance Method Details

#test_command(config) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/koine/test_runner/adapters/last_command.rb', line 9

def test_command(config)
  command = next_adapter.test_command(config)

  unless command
    return @storage.retrieve
  end

  @storage.store(command)
  command
end