dock_test 0.1.6 → 0.1.7
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 +9 -9
- data/lib/dock_test/dsl.rb +4 -4
- data/lib/dock_test/methods.rb +1 -1
- data/lib/dock_test/version.rb +1 -1
- data/test/dock_test/test_assertions.rb +1 -1
- data/test/test_helper.rb +8 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec9ca5aecb2bbcc74d8a649a71a25cd905b7f742
|
4
|
+
data.tar.gz: c04a3fba3daef9003c97f29cac924a0381bf6241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8db0d07aaed2367f795d222e0448a7d204f585f88861ee059893b384172d677e583941d1503457d5b9bf23e490168f0e7c8ef8bcf8f0c9def0a2f69544e57a9b
|
7
|
+
data.tar.gz: 42a889261be1a99777b4e0ebdceb879ad55c32ab684e2261bf7cd760283a20c970df79269b55cb58a523a42c0afe7df73862f480c4bc0d752f035335c82acd62
|
data/README.md
CHANGED
@@ -42,14 +42,14 @@ In your test helper file (often `test/test_helper.rb`), include the following Do
|
|
42
42
|
|
43
43
|
```ruby
|
44
44
|
DockTest.configure do |c|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
case ENV['DOCK_ENV']
|
46
|
+
when 'production'
|
47
|
+
c.url = 'http://vast-reaches-9635.herokuapp.com/' # your production service url
|
48
|
+
c.skippy = true
|
49
|
+
else
|
50
|
+
c.url = 'http://localhost:9871' # your local service url with abitary unbound port number
|
51
|
+
c.skippy = false
|
52
|
+
end
|
53
53
|
end
|
54
54
|
```
|
55
55
|
|
@@ -58,7 +58,7 @@ Add `include DockTest::Methods` to give your integration tests access to all the
|
|
58
58
|
Now you can excute your test collectively or individually, such as:
|
59
59
|
|
60
60
|
$ bundle exec rake test
|
61
|
-
$ DOCK_ENV=
|
61
|
+
$ DOCK_ENV=production bundle exec rake test
|
62
62
|
|
63
63
|
### Assumptions
|
64
64
|
|
data/lib/dock_test/dsl.rb
CHANGED
@@ -40,12 +40,12 @@ module DockTest
|
|
40
40
|
@url && ['127.0.0.1', 'localhost'].include?(URI.parse(@url).host)
|
41
41
|
end
|
42
42
|
|
43
|
-
def skippy=(
|
44
|
-
@
|
43
|
+
def skippy=(skippy)
|
44
|
+
@skippy = skippy
|
45
45
|
end
|
46
46
|
|
47
|
-
def
|
48
|
-
@
|
47
|
+
def skippy?
|
48
|
+
@skippy || false
|
49
49
|
end
|
50
50
|
|
51
51
|
def configure(&block)
|
data/lib/dock_test/methods.rb
CHANGED
data/lib/dock_test/version.rb
CHANGED
@@ -16,7 +16,7 @@ class TestAssertions < Minitest::Test
|
|
16
16
|
|
17
17
|
def test_assert_response_headers_method
|
18
18
|
get '/path?foo=bar', {a: :b}, {'CONTENT_TYPE' => 'application/json'}
|
19
|
-
assert_response_headers({"content-type"=>["application/json"]} , {exclude: ['content-length', 'server', 'connection', 'date', 'via']})
|
19
|
+
assert_response_headers({"content-type"=>["application/json"]} , {exclude: ['content-length', 'server', 'connection', 'date', 'via', 'age']})
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_assert_response_body_method
|
data/test/test_helper.rb
CHANGED
@@ -5,12 +5,13 @@ Bundler.require(:default, :test)
|
|
5
5
|
require 'dock_test'
|
6
6
|
|
7
7
|
DockTest.configure do |c|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
case ENV['DOCK_ENV']
|
9
|
+
when 'production'
|
10
|
+
c.url = 'http://floating-mesa-6194.herokuapp.com'
|
11
|
+
c.skippy = true
|
12
|
+
else
|
13
|
+
c.url = 'http://localhost:9871'
|
14
|
+
c.skippy = false
|
15
|
+
end
|
15
16
|
end
|
16
17
|
|
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.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Xu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|