rspec-default_http_header 0.0.1 → 0.0.2

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: f38b8abf9c8ffd57f1d0e2331d67c1fdbf778ab8
4
- data.tar.gz: d0fddfc4e7f05f7c4ec4e7a6db60f2cced230586
3
+ metadata.gz: b4f28b5d4f38a79f95e535a3655bef1c3a4ac24f
4
+ data.tar.gz: d2e76561dbfa3681b0349bb4d188eef94fac3213
5
5
  SHA512:
6
- metadata.gz: ac1aca990b46f0fd4e3dba9fbd0805a037c872a61bf3c8e04a1d215fcfe8560e07433021b550061d2dc412af2266d200ad3e2c83be06a84d0b9deb382e9532e9
7
- data.tar.gz: 0cea7e9a375bbf7abe70ce5f26e1568b66aae508c552b3ede005cd1adc28c018b25e5d70e3f191a7796b0bb5014c28fbcc10284f42c7a181a7b43a431d927634
6
+ metadata.gz: 54cdd1b1456b68e0876c2c0ab484123e1e5aff04ad175c8aa41077bb064a7f0b44cbdefea76f67c3fea906e7bcaa07caa4195b0b1ce170b6383a3c905e2da1cb
7
+ data.tar.gz: 2d0b4d3b4c17baa88fe3cba47d20fde87d92d8be8f061ebc2c518110cf0190b33607e126d1023512545768d5a98a4d57338d941eec5ef0be8e9bc85cda2d29c1
data/README.md CHANGED
@@ -25,7 +25,7 @@ Include RSpec::DefaultHeader into your RSpec.configuration.
25
25
 
26
26
  ```ruby
27
27
  RSpec.configure do |config|
28
- config.include RSpec::DefaultHeader, type: :request
28
+ config.include RSpec::DefaultHttpHeader, type: :request
29
29
  end
30
30
  ```
31
31
 
@@ -10,8 +10,18 @@ module RSpec
10
10
  let(:default_headers) { {} }
11
11
 
12
12
  HTTP_METHODS.each do |m|
13
- define_method(m) do |path, parameters = nil, headers_or_env = {}|
14
- super(path, parameters, default_headers.merge(headers_or_env))
13
+ if ActionPack::VERSION::MAJOR >= 5
14
+ define_method(m) do |path, *args|
15
+ if args[0].respond_to?(:has_key?) && args[0].has_key?(:headers)
16
+ args[0][:headers].merge!(default_headers)
17
+ end
18
+
19
+ super(path, *args)
20
+ end
21
+ else
22
+ define_method(m) do |path, parameters = nil, headers_or_env = {}|
23
+ super(path, parameters, default_headers.merge(headers_or_env))
24
+ end
15
25
  end
16
26
  end
17
27
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module DefaultHttpHeader
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-default_http_header
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenichi TAKAHASHI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-04 00:00:00.000000000 Z
11
+ date: 2016-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-rails
@@ -87,9 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.4.1
90
+ rubygems_version: 2.5.1
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Set default http headers in request specs
94
94
  test_files: []
95
- has_rdoc: