vcr-xml 0.0.2 → 0.0.3

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: 4311c1b70cc3002037592467099056cc0b2febc9
4
- data.tar.gz: 0de2179f84915a162f0b5a51d1de6ed442c75540
3
+ metadata.gz: f888ae5745e0932961e69a6afea8ea8d543404ab
4
+ data.tar.gz: 66af45cfcea81e470408c0ab21eab2dcc86ff828
5
5
  SHA512:
6
- metadata.gz: 0527364bd97d3b5e1f3084fab15d2121b8325751e7f3edca6554d5a784671ddfb2c5bc1a1c0ecdee4a0008c493bb4f9f0533bc7c0723469df2fa6d12dd61523e
7
- data.tar.gz: 360128fa1d019137b8717563e5077646f74bd26df84b8387f22b67a251dc29c00d6b0e3270bebdc22a6db6c1d178218387229ccaf2ee253849ed8c72e9175c9c
6
+ metadata.gz: 375ccecf1b89add47adba40aa4c3f3baca7a9dadf4b0be11f0eb0ccfb850871c81fbfde5b9f47dd038191318aff50c5aec080c7fa42f3786c0808d8ecb0828fc
7
+ data.tar.gz: 433de4ce3f6c440e7a33c04a0d27918ee83e56107e0bd350e6f6ae1d1150151e3f86707ed3410161c6f1fe342a3ac5cdd7e76e728c98c8af30f75fd21dd2b546
checksums.yaml.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.19 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABCgAGBQJRwWBXAAoJENcoxKfNVdjbqiIH/3swX0VZUwfFCICI2/ikFBrI
6
- l2TD6xvRV4eYiqQJ5lVsyWNFgZEVLgX6wRsivz/oBTYCTcHlc0M9B/El9Mvi0QHo
7
- a9DXREc/ro3/ytmBk17kCTrBgFsS7cl1kEbiOJBkVnEVGtoD/lTZmlSBURrsqMrK
8
- WSrfv3tnyzmxq/cTJh6VY0zcfaBqhMAc0tFZS4FMxQrJITFGHzfLdQ9j1ni3YxoB
9
- //HkBuBTnwzUz9uInrntl7dQtCSrwS3oPAuDi3dJNAK+LewWBWFrjnzOdz2kuDXT
10
- M6G59VzQnHBYBdk+ICLpdZQYtZ0cGIQMly3L9DwXzI4XYFO2C5ie9PmVxPOBVcU=
11
- =ECrl
5
+ iQEcBAABCgAGBQJRwWSYAAoJENcoxKfNVdjbuX8IAK+fC+fLzGJ2cvwCrDz8k1bf
6
+ DB6h7HOWSJeEjcH1Rzt/qsZWW+gEpCKLthLIS+RM3/Gse9uWkf9PbvozmQJngXIT
7
+ rHDdAy+rM+mbpJUqevC0g2bPULc3+bSyGsSjg6akzSR+iASc1IenBMmsemiJLbnG
8
+ 0pJfLt41cKZsSmC+uT2KYlZB09oL31AxMI5T0NR0zziL5ViKj0GSnVIFfZ34ysSw
9
+ BDwFupSfFqj4iGaNqPruE6VyaSxHgBVDhOLi96iHDp5fvcNmz8L8W6WrDBIXmwWn
10
+ bDqZb2dVJEta8DbK36fGA4nGDt7bhpLeAE48f3WST2JRCK+UcdbBKhVEQlyvApk=
11
+ =h9dv
12
12
  -----END PGP SIGNATURE-----
data.tar.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.19 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABCgAGBQJRwWBWAAoJENcoxKfNVdjb92IIAIXBcl8YAj1WOFgFd9n+ylUB
6
- dSMPIHpth9KXZpFTnF5fIIBz1hKta2mte4ZxUMwgImKmK7gEM36XaUnFA4MQ3Ni+
7
- pQ9YTdFU0k7V+875RoJ8r0qG7bCKlltvvZVb/TYHPmdm7dkt7IM9N+YGwejn+Jtn
8
- pI3A9gwZpQRfIwbkX499Z1JHPFswvwkNalhVbxu9FmRAMarkg/Y1msbgUG+5ScqU
9
- mNmA1DBRG4jFviKCIjeldiuHhfS3LWIxpCqu/zHPuCY+YD6O5ZvbBFX/CPtbux6H
10
- u82JtcRHpg+4kxfhp01AFMFAHgDMoLwVVdmAGn4LkZPo8jpyU/vwLn0xFk7yKRk=
11
- =j4Hf
5
+ iQEcBAABCgAGBQJRwWSYAAoJENcoxKfNVdjbDmQH/RRlqT0aoCtJOeKQhUqey7wU
6
+ qWoXC+gAEx9Zsg9NmRw7MGF7Lm0AjZzanrG3Ex5C14Y02dA3m+p6FvAMdQYH+VPr
7
+ NUXiXDoV7A8g+0gsrWSLEl/bOG33GwJ3gKmzqBkyLTsM5664668kmaE4VOAn+ttq
8
+ KY8+SZBaSazFjuh+Dho2RhioIf9mEzMUIMCTtkkUKG2YP3MMDa73xCmQmjhhLaWA
9
+ eBzuHa5r9Io7kY4N10fW4G7OqdwegCXzMLIMVliP01x8OTnAU1v/ZK8qT3Bx4Df5
10
+ u2v3m39ookuroM041ypnHBBH+7afR04rFnpXABUsC1u1utTBcHcs2X0/MRacfCY=
11
+ =UN/9
12
12
  -----END PGP SIGNATURE-----
@@ -0,0 +1,38 @@
1
+ module VCR
2
+ class HeaderMatcher < Struct.new(:keys)
3
+ def matches?(request, expected_request)
4
+ requested_headers = request.headers
5
+ expected_headers = expected_request.headers
6
+
7
+ if only_keys.present?
8
+ requested_headers.slice!(*only_keys)
9
+ expected_headers.slice!(*only_keys)
10
+ end
11
+
12
+ if without_keys.present?
13
+ requested_headers.except!(*without_keys)
14
+ expected_headers.except!(*without_keys)
15
+ end
16
+
17
+ requested_headers == expected_headers
18
+ end
19
+
20
+ def without_keys
21
+ keys.map do |k|
22
+ prefix, key_name = k.split(/^\^/)
23
+ key_name if key_name.present?
24
+ end.compact
25
+ end
26
+
27
+ def only_keys
28
+ keys.map do |k|
29
+ prefix, key_name = k.split(/^\^/)
30
+ prefix if prefix.present?
31
+ end.compact
32
+ end
33
+
34
+ def human_type
35
+ ""
36
+ end
37
+ end
38
+ end
@@ -1,5 +1,5 @@
1
1
  module Vcr
2
2
  module Xml
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcr-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Bokov
@@ -156,6 +156,7 @@ files:
156
156
  - lib/vcr/errors/unhandled_xml_request_error/headers.rb
157
157
  - lib/vcr/errors/unhandled_xml_request_error/matchers.rb
158
158
  - lib/vcr/errors/unhandled_xml_request_error/suggestions.rb
159
+ - lib/vcr/header_matcher.rb
159
160
  - lib/vcr/locales/en.yml
160
161
  - lib/vcr/locales/ru.yml
161
162
  - lib/vcr/not_xpath_matcher.rb
metadata.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.19 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABCgAGBQJRwWBWAAoJENcoxKfNVdjbU0gIAMq8agvKfsGxaXNgOJYVKJAn
6
- teUOFa+kbx5dGtbh7AhissHPhY8meGpWE7xIBYFGvtBkjOpemJmkcIGE/yEviFKT
7
- uG2153BNbBOAOm2Esz0c9h+ZtDQ+ei9XNrrSak8Z4wgZ1Fta+sNYF218xz9Bk2KO
8
- d3Qlht3Di3RQn5PUcxogwYE8LR4OzQaPY3og2oxMTC/GRRhbkYr8so5TrkMDFfT8
9
- Ts3ucBctXQx3yKrW+dRI+52yNrRn2ucYbrdvD8lEWWaSyLTb7QEu2jg01Vr4+oz9
10
- SuXEA438EWeU8o3aJgWa33XkYT8RTxIBP7Omp5jFk3qhG68ql1JdxM+NNbDQXSM=
11
- =5jJb
5
+ iQEcBAABCgAGBQJRwWSYAAoJENcoxKfNVdjbnU4IALAD5oG4Or3euLyqobZBfoWk
6
+ oAiXl5O2XPMZ3pMfvnWvZxndtDowxOZl/vZSAHc1iLG1Bt1s1JjNGkm0tZi5InWo
7
+ 3Ry6Oe149a86yBAW1q1J/SDUad04CsjmDiRmp8GYlFgsWZeCLA8tVrwUOBylhV6R
8
+ ZjmyVHPA+UdXIOcmfFRV88IE9OAxTIMwq8/EJso++NBDjJC5urOKt0fUpQzOFZr9
9
+ CW6w5z9P2dGMPQxG2ehKXKQOzV1khDC2+BueoHV7OzGFnaU2aqEzhahwpD574V3G
10
+ 6GbveY3CD1fP3upHZf4TEdiR449Ay1HsCCsc5SN7ktL+a5f/01fOl4+QEep3d8c=
11
+ =yZzm
12
12
  -----END PGP SIGNATURE-----