http_stub 0.9.7 → 0.11.0
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.
- data/lib/http_stub.rb +2 -0
- data/lib/http_stub/daemon.rb +36 -0
- data/lib/http_stub/rake/daemon_tasks.rb +14 -0
- data/lib/http_stub/rake/server_tasks.rb +13 -11
- data/lib/http_stub/rake/task_generators.rb +3 -0
- data/lib/http_stub/version.rb +1 -1
- data/spec/lib/http_stub/daemon_integration_spec.rb +7 -0
- data/spec/lib/http_stub/daemon_spec.rb +71 -0
- data/spec/lib/http_stub/rake/daemon_tasks_smoke_spec.rb +31 -0
- data/spec/lib/http_stub/rake/server_tasks_smoke_spec.rb +30 -0
- data/spec/lib/http_stub/rake/server_tasks_spec.rb +2 -2
- data/spec/spec_helper.rb +8 -1
- data/spec/support/server_integration.rb +1 -1
- metadata +35 -11
- data/spec/lib/http_stub/rake/server_tasks_integration_spec.rb +0 -21
data/lib/http_stub.rb
CHANGED
@@ -8,6 +8,7 @@ require 'haml'
|
|
8
8
|
require 'sass'
|
9
9
|
require 'net/http'
|
10
10
|
require 'json'
|
11
|
+
require 'http_server_manager'
|
11
12
|
|
12
13
|
require File.expand_path('../http_stub/hash_extensions', __FILE__)
|
13
14
|
require File.expand_path('../http_stub/models/response', __FILE__)
|
@@ -27,6 +28,7 @@ require File.expand_path('../http_stub/models/request_pipeline', __FILE__)
|
|
27
28
|
require File.expand_path('../http_stub/controllers/stub_controller', __FILE__)
|
28
29
|
require File.expand_path('../http_stub/controllers/stub_activator_controller', __FILE__)
|
29
30
|
require File.expand_path('../http_stub/server', __FILE__)
|
31
|
+
require File.expand_path('../http_stub/daemon', __FILE__)
|
30
32
|
require File.expand_path('../http_stub/configurer/request/omittable', __FILE__)
|
31
33
|
require File.expand_path('../http_stub/configurer/request/regexpable', __FILE__)
|
32
34
|
require File.expand_path('../http_stub/configurer/request/controllable_value', __FILE__)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module HttpStub
|
2
|
+
|
3
|
+
class Daemon < HttpServerManager::Server
|
4
|
+
|
5
|
+
class << self
|
6
|
+
|
7
|
+
def pid_dir=(dir)
|
8
|
+
HttpServerManager.pid_dir = dir
|
9
|
+
end
|
10
|
+
|
11
|
+
def log_dir=(dir)
|
12
|
+
HttpServerManager.log_dir = dir
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize(options)
|
18
|
+
super({ host: "localhost" }.merge(options))
|
19
|
+
@configurer = options[:configurer]
|
20
|
+
end
|
21
|
+
|
22
|
+
def start!
|
23
|
+
super
|
24
|
+
if @configurer
|
25
|
+
@configurer.initialize!
|
26
|
+
logger.info "#{@name} initialized"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def start_command
|
31
|
+
"rake #{@name}:start:foreground"
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module HttpStub
|
2
|
+
module Rake
|
3
|
+
|
4
|
+
class DaemonTasks < ::Rake::TaskLib
|
5
|
+
|
6
|
+
def initialize(options)
|
7
|
+
HttpStub::Rake::ServerTasks.new(options)
|
8
|
+
namespace(options[:name]) { HttpServerManager::Rake::ServerTasks.new(HttpStub::Daemon.new(options)) }
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -1,34 +1,36 @@
|
|
1
1
|
module HttpStub
|
2
|
-
|
3
2
|
module Rake
|
4
3
|
|
5
4
|
class ServerTasks < ::Rake::TaskLib
|
6
5
|
|
7
6
|
def initialize(options)
|
8
|
-
|
9
|
-
|
7
|
+
namespace options[:name] do
|
8
|
+
define_start_task(options)
|
9
|
+
define_initialize_task(options) if options[:configurer]
|
10
|
+
end
|
10
11
|
end
|
11
12
|
|
12
13
|
private
|
13
14
|
|
14
15
|
def define_start_task(options)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
namespace :start do
|
17
|
+
desc "Starts stub #{options[:name]} in the foreground"
|
18
|
+
task(:foreground) do
|
19
|
+
HttpStub::Server.instance_eval do
|
20
|
+
set :environment, :test
|
21
|
+
set :port, options[:port]
|
22
|
+
run!
|
23
|
+
end
|
21
24
|
end
|
22
25
|
end
|
23
26
|
end
|
24
27
|
|
25
28
|
def define_initialize_task(options)
|
26
29
|
desc "Configures stub #{options[:name]}"
|
27
|
-
task(
|
30
|
+
task(:configure) { options[:configurer].initialize! }
|
28
31
|
end
|
29
32
|
|
30
33
|
end
|
31
34
|
|
32
35
|
end
|
33
|
-
|
34
36
|
end
|
@@ -1,4 +1,7 @@
|
|
1
1
|
require File.expand_path('../../../http_stub', __FILE__)
|
2
2
|
require 'rake/tasklib' unless defined? (::Rake::TaskLib)
|
3
3
|
|
4
|
+
require 'http_server_manager/rake/task_generators'
|
5
|
+
|
4
6
|
require File.expand_path('../server_tasks', __FILE__)
|
7
|
+
require File.expand_path('../daemon_tasks', __FILE__)
|
data/lib/http_stub/version.rb
CHANGED
@@ -0,0 +1,71 @@
|
|
1
|
+
describe HttpStub::Daemon do
|
2
|
+
|
3
|
+
let(:configurer) { nil }
|
4
|
+
|
5
|
+
let(:daemon) { HttpStub::Daemon.new(name: :sample_daemon, port: 8888, configurer: configurer) }
|
6
|
+
|
7
|
+
before(:each) { daemon.logger.stub(:info) }
|
8
|
+
|
9
|
+
describe ".log_dir" do
|
10
|
+
|
11
|
+
before(:each) { @original_log_dir = HttpServerManager.log_dir }
|
12
|
+
|
13
|
+
after(:each) { HttpServerManager.log_dir = @original_log_dir }
|
14
|
+
|
15
|
+
it "should establish the HttpServerManager log_dir" do
|
16
|
+
HttpStub::Daemon.log_dir = "/some/log/dir"
|
17
|
+
|
18
|
+
HttpServerManager.log_dir.should eql("/some/log/dir")
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
describe ".pid_dir" do
|
24
|
+
|
25
|
+
before(:each) { @original_pid_dir = HttpServerManager.pid_dir }
|
26
|
+
|
27
|
+
after(:each) { HttpServerManager.pid_dir = @original_pid_dir }
|
28
|
+
|
29
|
+
it "should establish the HttpServerManager pid_dir" do
|
30
|
+
HttpStub::Daemon.pid_dir = "/some/pid/dir"
|
31
|
+
|
32
|
+
HttpServerManager.pid_dir.should eql("/some/pid/dir")
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
describe "#start!" do
|
38
|
+
|
39
|
+
before(:each) { daemon.stub(:running?).and_return(true) }
|
40
|
+
|
41
|
+
context "when a configurer is provided" do
|
42
|
+
|
43
|
+
let(:configurer) { double(HttpStub::Configurer).as_null_object }
|
44
|
+
|
45
|
+
it "should initialize the configurer" do
|
46
|
+
configurer.should_receive(:initialize!)
|
47
|
+
|
48
|
+
daemon.start!
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should log that the daemon with the provided name has been initialized" do
|
52
|
+
daemon.logger.should_receive(:info).with("sample_daemon initialized")
|
53
|
+
|
54
|
+
daemon.start!
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
context "when no configurer is provided" do
|
60
|
+
|
61
|
+
it "should not log that the daemon has been initialized" do
|
62
|
+
daemon.logger.should_not_receive(:info).with("sample_daemon initialized")
|
63
|
+
|
64
|
+
daemon.start!
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
describe HttpStub::Rake::DaemonTasks do
|
2
|
+
include Rake::DSL
|
3
|
+
|
4
|
+
before(:all) { HttpStub::Rake::DaemonTasks.new(name: :example_daemon, port: 8002) }
|
5
|
+
|
6
|
+
describe "start task" do
|
7
|
+
|
8
|
+
context "when invoked" do
|
9
|
+
|
10
|
+
before(:all) { @exit_flag = Rake::Task["example_daemon:start"].invoke("--trace") }
|
11
|
+
|
12
|
+
after(:all) { Rake::Task["example_daemon:stop"].invoke("--trace") }
|
13
|
+
|
14
|
+
it "should exit with a status code of 0" do
|
15
|
+
@exit_flag.should be_true
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should start a stub server that responds to stub requests" do
|
19
|
+
request = Net::HTTP::Post.new("/stubs")
|
20
|
+
request.body = { "response" => { "status" => 302, "body" => "Some Body" } }.to_json
|
21
|
+
|
22
|
+
response = Net::HTTP.new("localhost", 8002).start { |http| http.request(request) }
|
23
|
+
|
24
|
+
response.code.should eql("200")
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
describe HttpStub::Rake::ServerTasks do
|
2
|
+
include Rake::DSL
|
3
|
+
|
4
|
+
before(:all) { HttpStub::Rake::ServerTasks.new(name: :test_server, port: 8003) }
|
5
|
+
|
6
|
+
describe "start task" do
|
7
|
+
|
8
|
+
context "when invoked" do
|
9
|
+
|
10
|
+
before(:all) do
|
11
|
+
@server_thread = Thread.new { Rake::Task["test_server:start:foreground"].invoke("--trace") }
|
12
|
+
::Wait.until!("http stub server started") { Net::HTTP.get_response("localhost", "/", 8003) }
|
13
|
+
end
|
14
|
+
|
15
|
+
after(:all) { @server_thread.kill }
|
16
|
+
|
17
|
+
it "should start a stub server that responds to stub requests" do
|
18
|
+
request = Net::HTTP::Post.new("/stubs")
|
19
|
+
request.body = { "response" => { "status" => 302, "body" => "Some Body" } }.to_json
|
20
|
+
|
21
|
+
response = Net::HTTP.new("localhost", 8003).start { |http| http.request(request) }
|
22
|
+
|
23
|
+
response.code.should eql("200")
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -16,7 +16,7 @@ describe HttpStub::Rake::ServerTasks do
|
|
16
16
|
it "should initialize the provided configurer" do
|
17
17
|
configurer.should_receive(:initialize!)
|
18
18
|
|
19
|
-
Rake::Task[:
|
19
|
+
Rake::Task["tasks_configurer_provided_test:configure"].execute
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
@@ -28,7 +28,7 @@ describe HttpStub::Rake::ServerTasks do
|
|
28
28
|
let(:options) { { name: :tasks_configurer_not_provided_test } }
|
29
29
|
|
30
30
|
it "should not generate a task" do
|
31
|
-
lambda { Rake::Task[:
|
31
|
+
lambda { Rake::Task["tasks_configurer_not_provided_test:configure"] }.should
|
32
32
|
raise_error(/Don't know how to build task/)
|
33
33
|
end
|
34
34
|
|
data/spec/spec_helper.rb
CHANGED
@@ -2,7 +2,7 @@ require 'simplecov'
|
|
2
2
|
SimpleCov.start do
|
3
3
|
add_filter "/spec/"
|
4
4
|
add_filter "/vendor/"
|
5
|
-
minimum_coverage
|
5
|
+
minimum_coverage 99.2
|
6
6
|
refuse_coverage_drop
|
7
7
|
end if ENV["coverage"]
|
8
8
|
|
@@ -11,6 +11,8 @@ require 'nokogiri'
|
|
11
11
|
require 'rack/test'
|
12
12
|
require 'wait_until'
|
13
13
|
|
14
|
+
require 'http_server_manager/test_support'
|
15
|
+
|
14
16
|
require File.expand_path('../../lib/http_stub/rake/task_generators', __FILE__)
|
15
17
|
require File.expand_path('../../lib/http_stub', __FILE__)
|
16
18
|
require File.expand_path('../../examples/configurer_with_class_activator', __FILE__)
|
@@ -19,4 +21,9 @@ require File.expand_path('../../examples/configurer_with_initialize_callback', _
|
|
19
21
|
require File.expand_path('../../examples/configurer_with_complex_initializer', __FILE__)
|
20
22
|
require File.expand_path('../../examples/configurer_with_many_class_activators', __FILE__)
|
21
23
|
|
24
|
+
HttpStub::Daemon.log_dir = File.expand_path('../../tmp/log', __FILE__)
|
25
|
+
HttpStub::Daemon.pid_dir = File.expand_path('../../tmp/pids', __FILE__)
|
26
|
+
|
27
|
+
HttpServerManager.logger = HttpServerManager::Test::SilentLogger
|
28
|
+
|
22
29
|
Dir[File.expand_path('../support/**/*.rb', __FILE__)].each { |file| require file }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
shared_context "server integration" do
|
2
2
|
|
3
3
|
before(:all) do
|
4
|
-
@pid = Process.spawn("rake
|
4
|
+
@pid = Process.spawn("rake example_server:start:foreground --trace")
|
5
5
|
::Wait.until!("http stub server started") { Net::HTTP.get_response(server_host, "/", server_port) }
|
6
6
|
end
|
7
7
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_stub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-11-
|
13
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sinatra
|
@@ -92,6 +92,22 @@ dependencies:
|
|
92
92
|
- - ~>
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '10.1'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: http_server_manager
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ~>
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0.4'
|
103
|
+
type: :runtime
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.4'
|
95
111
|
- !ruby/object:Gem::Dependency
|
96
112
|
name: travis-lint
|
97
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,7 +131,7 @@ dependencies:
|
|
115
131
|
requirements:
|
116
132
|
- - ~>
|
117
133
|
- !ruby/object:Gem::Version
|
118
|
-
version: '4.
|
134
|
+
version: '4.5'
|
119
135
|
type: :development
|
120
136
|
prerelease: false
|
121
137
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -123,7 +139,7 @@ dependencies:
|
|
123
139
|
requirements:
|
124
140
|
- - ~>
|
125
141
|
- !ruby/object:Gem::Version
|
126
|
-
version: '4.
|
142
|
+
version: '4.5'
|
127
143
|
- !ruby/object:Gem::Dependency
|
128
144
|
name: rspec
|
129
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,7 +163,7 @@ dependencies:
|
|
147
163
|
requirements:
|
148
164
|
- - ~>
|
149
165
|
- !ruby/object:Gem::Version
|
150
|
-
version: '0.
|
166
|
+
version: '0.8'
|
151
167
|
type: :development
|
152
168
|
prerelease: false
|
153
169
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -155,7 +171,7 @@ dependencies:
|
|
155
171
|
requirements:
|
156
172
|
- - ~>
|
157
173
|
- !ruby/object:Gem::Version
|
158
|
-
version: '0.
|
174
|
+
version: '0.8'
|
159
175
|
- !ruby/object:Gem::Dependency
|
160
176
|
name: rake
|
161
177
|
requirement: !ruby/object:Gem::Requirement
|
@@ -227,7 +243,7 @@ dependencies:
|
|
227
243
|
requirements:
|
228
244
|
- - ~>
|
229
245
|
- !ruby/object:Gem::Version
|
230
|
-
version: 0.
|
246
|
+
version: '0.1'
|
231
247
|
type: :development
|
232
248
|
prerelease: false
|
233
249
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -235,7 +251,7 @@ dependencies:
|
|
235
251
|
requirements:
|
236
252
|
- - ~>
|
237
253
|
- !ruby/object:Gem::Version
|
238
|
-
version: 0.
|
254
|
+
version: '0.1'
|
239
255
|
- !ruby/object:Gem::Dependency
|
240
256
|
name: json
|
241
257
|
requirement: !ruby/object:Gem::Requirement
|
@@ -270,6 +286,7 @@ files:
|
|
270
286
|
- ./lib/http_stub/configurer.rb
|
271
287
|
- ./lib/http_stub/controllers/stub_activator_controller.rb
|
272
288
|
- ./lib/http_stub/controllers/stub_controller.rb
|
289
|
+
- ./lib/http_stub/daemon.rb
|
273
290
|
- ./lib/http_stub/hash_extensions.rb
|
274
291
|
- ./lib/http_stub/models/exact_value_matcher.rb
|
275
292
|
- ./lib/http_stub/models/hash_with_value_matchers.rb
|
@@ -285,6 +302,7 @@ files:
|
|
285
302
|
- ./lib/http_stub/models/stub_parameters.rb
|
286
303
|
- ./lib/http_stub/models/stub_uri.rb
|
287
304
|
- ./lib/http_stub/models/value_matcher.rb
|
305
|
+
- ./lib/http_stub/rake/daemon_tasks.rb
|
288
306
|
- ./lib/http_stub/rake/server_tasks.rb
|
289
307
|
- ./lib/http_stub/rake/task_generators.rb
|
290
308
|
- ./lib/http_stub/server.rb
|
@@ -309,6 +327,8 @@ files:
|
|
309
327
|
- ./spec/lib/http_stub/configurer_spec.rb
|
310
328
|
- ./spec/lib/http_stub/controllers/stub_activator_controller_spec.rb
|
311
329
|
- ./spec/lib/http_stub/controllers/stub_controller_spec.rb
|
330
|
+
- ./spec/lib/http_stub/daemon_integration_spec.rb
|
331
|
+
- ./spec/lib/http_stub/daemon_spec.rb
|
312
332
|
- ./spec/lib/http_stub/hash_extensions_spec.rb
|
313
333
|
- ./spec/lib/http_stub/models/exact_value_matcher_spec.rb
|
314
334
|
- ./spec/lib/http_stub/models/hash_with_value_matchers_spec.rb
|
@@ -324,7 +344,8 @@ files:
|
|
324
344
|
- ./spec/lib/http_stub/models/stub_spec.rb
|
325
345
|
- ./spec/lib/http_stub/models/stub_uri_spec.rb
|
326
346
|
- ./spec/lib/http_stub/models/value_matcher_spec.rb
|
327
|
-
- ./spec/lib/http_stub/rake/
|
347
|
+
- ./spec/lib/http_stub/rake/daemon_tasks_smoke_spec.rb
|
348
|
+
- ./spec/lib/http_stub/rake/server_tasks_smoke_spec.rb
|
328
349
|
- ./spec/lib/http_stub/rake/server_tasks_spec.rb
|
329
350
|
- ./spec/lib/http_stub/server_integration_spec.rb
|
330
351
|
- ./spec/lib/http_stub/server_spec.rb
|
@@ -351,7 +372,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
351
372
|
version: '0'
|
352
373
|
segments:
|
353
374
|
- 0
|
354
|
-
hash:
|
375
|
+
hash: 244872953293739403
|
355
376
|
requirements: []
|
356
377
|
rubyforge_project: http_stub
|
357
378
|
rubygems_version: 1.8.25
|
@@ -373,6 +394,8 @@ test_files:
|
|
373
394
|
- ./spec/lib/http_stub/configurer_spec.rb
|
374
395
|
- ./spec/lib/http_stub/controllers/stub_activator_controller_spec.rb
|
375
396
|
- ./spec/lib/http_stub/controllers/stub_controller_spec.rb
|
397
|
+
- ./spec/lib/http_stub/daemon_integration_spec.rb
|
398
|
+
- ./spec/lib/http_stub/daemon_spec.rb
|
376
399
|
- ./spec/lib/http_stub/hash_extensions_spec.rb
|
377
400
|
- ./spec/lib/http_stub/models/exact_value_matcher_spec.rb
|
378
401
|
- ./spec/lib/http_stub/models/hash_with_value_matchers_spec.rb
|
@@ -388,7 +411,8 @@ test_files:
|
|
388
411
|
- ./spec/lib/http_stub/models/stub_spec.rb
|
389
412
|
- ./spec/lib/http_stub/models/stub_uri_spec.rb
|
390
413
|
- ./spec/lib/http_stub/models/value_matcher_spec.rb
|
391
|
-
- ./spec/lib/http_stub/rake/
|
414
|
+
- ./spec/lib/http_stub/rake/daemon_tasks_smoke_spec.rb
|
415
|
+
- ./spec/lib/http_stub/rake/server_tasks_smoke_spec.rb
|
392
416
|
- ./spec/lib/http_stub/rake/server_tasks_spec.rb
|
393
417
|
- ./spec/lib/http_stub/server_integration_spec.rb
|
394
418
|
- ./spec/lib/http_stub/server_spec.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
describe HttpStub::Rake::ServerTasks do
|
2
|
-
include_context "server integration"
|
3
|
-
|
4
|
-
describe "the start task" do
|
5
|
-
|
6
|
-
context "when invoked" do
|
7
|
-
|
8
|
-
it "should start a stub server that responds to stub requests" do
|
9
|
-
request = Net::HTTP::Post.new("/stubs")
|
10
|
-
request.body = { "response" => { "status" => 302, "body" => "Some Body" } }.to_json
|
11
|
-
|
12
|
-
response = Net::HTTP.new("localhost", 8001).start { |http| http.request(request) }
|
13
|
-
|
14
|
-
response.code.should eql("200")
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|