Module: HttpTest
- Defined in:
- lib/http-test/server/port.rb,
lib/http-test.rb,
lib/http-test/session.rb,
lib/http-test/version.rb
Overview
helper methods for port handling —————————————
Defined Under Namespace
Modules: HttpMethods, Server, TestUnitAdapter
Classes: Session, TestCase
Constant Summary
collapse
- VERSION =
"0.1.4"
Class Method Summary
collapse
Class Method Details
.start_session(session_parameters) ⇒ Object
5
6
7
8
|
# File 'lib/http-test.rb', line 5
def self.start_session(session_parameters)
url_base, command = session_parameters.values_at :url_base, :command
@session = Session.start! url_base: url_base, command: command
end
|
.stop_session ⇒ Object
10
11
12
|
# File 'lib/http-test.rb', line 10
def self.stop_session
@session = nil
end
|
.url_base ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/http-test.rb', line 14
def self.url_base
return @session.url_base if @session
STDERR.puts "http-test: I was unable to find a API endpoint.\n\nEither:\n\n- define a API endpoint via `url_base <url>`, if the test server is not controlled by this script, or\n- define a command to start a test_server via `test_server \"command\"`\n\n"
raise "Missing HttpTest session, you must run HttpTest.start_session first!"
end
|