dock_test 0.3.5 → 0.3.6
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.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/dock_test/dsl.rb +6 -1
- data/lib/dock_test/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e16bf05cab2df84e1b82b0acc1187b9cea015264
|
4
|
+
data.tar.gz: 8eb989138957809a55fd749fce882e50b39d2e3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5917f5f5ba0d514c65a0dc71e1f151cf4172619949c3581617d33dcc9cd6cb44a7007cd01dbf504022b3692392aadd68af714bedaf9199e03440bcf99d12f913
|
7
|
+
data.tar.gz: 22c68dc05259ed7272a3bcfce20bc28b0fe63d97436ebe969a45f61e480a1262cb5781ab9e787f99fdd1488ab63071b792361417e0c189c6e4149642affc0fe0
|
data/README.md
CHANGED
@@ -17,6 +17,7 @@ Different from the popular [Rack::Test], DockTest focuses on just on service app
|
|
17
17
|
6. same methods as [Rack::Test] for easy test reuse.
|
18
18
|
7. support for OAuth requests
|
19
19
|
8. support for displaying equivalent curl command using `OUTPUT_CURL` environment variable.
|
20
|
+
9. support for script_name localhost testing.
|
20
21
|
|
21
22
|
### Sample Application
|
22
23
|
|
data/lib/dock_test/dsl.rb
CHANGED
@@ -14,7 +14,7 @@ module DockTest
|
|
14
14
|
ARGV.clear # clear ARGV as it is used by Rack to configure server
|
15
15
|
|
16
16
|
server = WEBrick::HTTPServer.new(:Port => port, AccessLog: []).tap do |server|
|
17
|
-
server.mount
|
17
|
+
server.mount mount_path, Rack::Handler::WEBrick, Rack::Server.new.app
|
18
18
|
end
|
19
19
|
@server_thread = Thread.new { server.start }
|
20
20
|
trap('INT') do
|
@@ -32,6 +32,11 @@ module DockTest
|
|
32
32
|
oauth_consumer_key && oauth_consumer_secret
|
33
33
|
end
|
34
34
|
|
35
|
+
def mount_path
|
36
|
+
p = URI.parse(@url).path
|
37
|
+
p.empty? ? '/' : p
|
38
|
+
end
|
39
|
+
|
35
40
|
def port
|
36
41
|
URI.parse(@url).port
|
37
42
|
end
|
data/lib/dock_test/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dock_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Xu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
157
|
+
rubygems_version: 2.1.9
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: an outside-in service api test framework.
|