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 +4 -4
- data/README.md +1 -1
- data/lib/rspec/default_http_header.rb +12 -2
- data/lib/rspec/default_http_header/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4f28b5d4f38a79f95e535a3655bef1c3a4ac24f
|
4
|
+
data.tar.gz: d2e76561dbfa3681b0349bb4d188eef94fac3213
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54cdd1b1456b68e0876c2c0ab484123e1e5aff04ad175c8aa41077bb064a7f0b44cbdefea76f67c3fea906e7bcaa07caa4195b0b1ce170b6383a3c905e2da1cb
|
7
|
+
data.tar.gz: 2d0b4d3b4c17baa88fe3cba47d20fde87d92d8be8f061ebc2c518110cf0190b33607e126d1023512545768d5a98a4d57338d941eec5ef0be8e9bc85cda2d29c1
|
data/README.md
CHANGED
@@ -10,8 +10,18 @@ module RSpec
|
|
10
10
|
let(:default_headers) { {} }
|
11
11
|
|
12
12
|
HTTP_METHODS.each do |m|
|
13
|
-
|
14
|
-
|
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
|
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.
|
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:
|
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.
|
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:
|