Class: Httpotemkin::Test
- Inherits:
-
Object
- Object
- Httpotemkin::Test
- Defined in:
- lib/test.rb
Instance Method Summary collapse
- #add_server(name) ⇒ Object
- #down ⇒ Object
-
#initialize(out: $stdout) ⇒ Test
constructor
A new instance of Test.
- #run ⇒ Object
- #start_client ⇒ Object
- #stop_client ⇒ Object
- #up ⇒ Object
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 |
#down ⇒ Object
27 28 29 |
# File 'lib/test.rb', line 27 def down @containers.down end |
#run ⇒ Object
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_client ⇒ Object
31 32 33 34 |
# File 'lib/test.rb', line 31 def start_client @containers.start_client Client.new(@containers) end |
#stop_client ⇒ Object
36 37 38 |
# File 'lib/test.rb', line 36 def stop_client @containers.stop_client end |
#up ⇒ Object
23 24 25 |
# File 'lib/test.rb', line 23 def up @containers.up end |