dock_test 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1db8dc8c4606708bfaec803d2367dc774219377d
4
- data.tar.gz: 8216f0d45bb7496eca95d6667ba8d45c2534cd87
3
+ metadata.gz: ec9ca5aecb2bbcc74d8a649a71a25cd905b7f742
4
+ data.tar.gz: c04a3fba3daef9003c97f29cac924a0381bf6241
5
5
  SHA512:
6
- metadata.gz: 0c5cd37ff01452292ca600fca61c711365a5c062054c3ccfc501eefe86edf53b06b3f30786c7f75d6e38043a8997d3145ae5d37a8ba1f7792c8e12b9937fef68
7
- data.tar.gz: bc33ef1499b6de74a14da4cbfc7fd12f618be94ae66cd018aa59979a74be148f43c251f8ee3d4d9e3f5d0274f9bae69c896264917d46775552123712ea768073
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
- c.url = case ENV['DOCK_ENV']
46
- when 'production'
47
- 'http://vast-reaches-9635.herokuapp.com/' # your production service url
48
- when ...
49
- else
50
- 'http://localhost:9871' # your local service url with abitary unbound port number
51
- end
52
- c.skippy = :production # in production mode, skip all the post, delete, put requests.
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=product bundle exec rake test
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=(envs)
44
- @skippy_envs = Array(envs).map(&:to_s)
43
+ def skippy=(skippy)
44
+ @skippy = skippy
45
45
  end
46
46
 
47
- def skippy_envs
48
- @skippy_envs ||= ['production']
47
+ def skippy?
48
+ @skippy || false
49
49
  end
50
50
 
51
51
  def configure(&block)
@@ -8,7 +8,7 @@ module DockTest
8
8
 
9
9
  with_side_effects = verb_has_side_effects?(meth_name)
10
10
 
11
- if with_side_effects && DockTest.skippy_envs.include?(dock_env)
11
+ if with_side_effects && DockTest.skippy?
12
12
  skip_test_to_avoid_side_efforts
13
13
  end
14
14
 
@@ -1,3 +1,3 @@
1
1
  module DockTest
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -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
- c.url = case ENV['DOCK_ENV']
9
- when 'production'
10
- 'http://floating-mesa-6194.herokuapp.com'
11
- else
12
- 'http://localhost:9871'
13
- end
14
- c.skippy = :production
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.6
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-09 00:00:00.000000000 Z
11
+ date: 2014-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json