Class: OmaGem::Client::Fake

Inherits:
Client
  • Object
show all
Defined in:
lib/omagem/client.rb

Overview

A no-op client that records every call instead of running anything. Useful for tests and for "dry run" configuration building.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Fake

Returns a new instance of Fake.



44
45
46
47
# File 'lib/omagem/client.rb', line 44

def initialize
  super(command: 'omarchy')
  @calls = []
end

Instance Attribute Details

#calls ⇒ Object (readonly)

Returns the value of attribute calls.



42
43
44
# File 'lib/omagem/client.rb', line 42

def calls
  @calls
end

Instance Method Details

#run(*args) ⇒ Object



49
50
51
52
# File 'lib/omagem/client.rb', line 49

def run(*args)
  @calls << args
  Result.new(success: true, stdout: '', stderr: '', status: 0)
end