http_server_manager 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
describe HttpServerManager::Server, "managing a real server" do
|
|
2
2
|
include_context "managed http server integration utilities"
|
|
3
3
|
|
|
4
|
-
let(:
|
|
4
|
+
let(:name) { "test_server" }
|
|
5
|
+
let(:host) { "localhost" }
|
|
6
|
+
let(:port) { 4001 }
|
|
7
|
+
|
|
8
|
+
let(:server) { RackServer.new(name: name, host: host, port: port) }
|
|
5
9
|
|
|
6
10
|
describe "#start!" do
|
|
7
11
|
|
|
@@ -20,19 +24,19 @@ describe HttpServerManager::Server, "managing a real server" do
|
|
|
20
24
|
it "should create a pid file for the server in the configured pid directory" do
|
|
21
25
|
server.start!
|
|
22
26
|
|
|
23
|
-
::Wait.until_true!("
|
|
27
|
+
::Wait.until_true!("server pid created") { pid_file_exists? }
|
|
24
28
|
end
|
|
25
29
|
|
|
26
30
|
it "should create a log file capturing the stdout and stderr of the server in the configured log directory" do
|
|
27
31
|
server.start!
|
|
28
32
|
|
|
29
33
|
::Wait.until_true!("log file is created") do
|
|
30
|
-
File.exists?("#{log_dir}
|
|
34
|
+
File.exists?("#{log_dir}/#{name}_console.log")
|
|
31
35
|
end
|
|
32
36
|
end
|
|
33
37
|
|
|
34
38
|
it "should log that the server started on the configured port" do
|
|
35
|
-
logger.should_receive(:info).with(/started on
|
|
39
|
+
logger.should_receive(:info).with(/started on #{host}:#{port}/)
|
|
36
40
|
|
|
37
41
|
server.start!
|
|
38
42
|
end
|
|
@@ -47,7 +51,7 @@ describe HttpServerManager::Server, "managing a real server" do
|
|
|
47
51
|
end
|
|
48
52
|
|
|
49
53
|
it "should log that the server is already running on the configured port" do
|
|
50
|
-
logger.should_receive(:info).with(/already running on
|
|
54
|
+
logger.should_receive(:info).with(/already running on #{host}:#{port}/)
|
|
51
55
|
|
|
52
56
|
server.start!
|
|
53
57
|
end
|
|
@@ -73,8 +77,8 @@ describe HttpServerManager::Server, "managing a real server" do
|
|
|
73
77
|
it "should delete the servers pid file" do
|
|
74
78
|
server.stop!
|
|
75
79
|
|
|
76
|
-
::Wait.until_false!("
|
|
77
|
-
File.exists?("#{pid_dir}
|
|
80
|
+
::Wait.until_false!("server pid is deleted") do
|
|
81
|
+
File.exists?("#{pid_dir}/#{name}.pid")
|
|
78
82
|
end
|
|
79
83
|
end
|
|
80
84
|
|
|
@@ -157,15 +161,15 @@ describe HttpServerManager::Server, "managing a real server" do
|
|
|
157
161
|
describe "#to_s" do
|
|
158
162
|
|
|
159
163
|
it "should return a string containing the servers name" do
|
|
160
|
-
server.to_s.should match(
|
|
164
|
+
server.to_s.should match(name)
|
|
161
165
|
end
|
|
162
166
|
|
|
163
167
|
it "should return a string containing the servers host" do
|
|
164
|
-
server.to_s.should match(
|
|
168
|
+
server.to_s.should match(host)
|
|
165
169
|
end
|
|
166
170
|
|
|
167
171
|
it "should return a string containing the servers port" do
|
|
168
|
-
server.to_s.should match(
|
|
172
|
+
server.to_s.should match(port.to_s)
|
|
169
173
|
end
|
|
170
174
|
|
|
171
175
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: http_server_manager
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-10-
|
|
12
|
+
date: 2013-10-28 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rake
|