Class: Httpotemkin::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/test.rb

Instance Method Summary collapse

Constructor Details

#initialize(out: $stdout) ⇒ Test

Returns a new instance of Test.



3
4
5
6
# File 'lib/test.rb', line 3

def initialize(out: $stdout)
  @containers = Containers.new
  @containers.out = out
end

Instance Method Details

#add_server(name) ⇒ Object



8
9
10
# File 'lib/test.rb', line 8

def add_server(name)
  @containers.add_server(name)
end

#downObject



27
28
29
# File 'lib/test.rb', line 27

def down
  @containers.down
end

#runObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/test.rb', line 12

def run
  @containers.up
  @containers.start_client
  begin
    yield Client.new(@containers)
  ensure
    @containers.stop_client
    @containers.down
  end
end

#start_clientObject



31
32
33
34
# File 'lib/test.rb', line 31

def start_client
  @containers.start_client
  Client.new(@containers)
end

#stop_clientObject



36
37
38
# File 'lib/test.rb', line 36

def stop_client
  @containers.stop_client
end

#upObject



23
24
25
# File 'lib/test.rb', line 23

def up
  @containers.up
end