rspec-proxypac 0.1.0 → 0.1.1
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/.rspec +2 -0
- data/.rubocop.yml +7 -0
- data/.travis.yml +6 -0
- data/lib/rspec_proxypac.rb +1 -2
- data/lib/rspec_proxypac/find_proxy.rb +6 -5
- data/lib/rspec_proxypac/pac.rb +17 -0
- data/lib/rspec_proxypac/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9e8eb584b7daabc3f4e1ac08687dc03db52855a
|
4
|
+
data.tar.gz: df58d62c132ba22d2df0be4b9b3c5e434486d859
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b866d0d278dc35238a9d713c6be93695a4694ddc2c1224407b9b6778f8d0b19784fea976d029a75cb6ad1e0cd3535aa6810007e0fe2d8a76a047c0a45b06607a
|
7
|
+
data.tar.gz: bd3b3bfcc453c9f9a7e5bde07773242e10fc3c917fdfa3c6eae9a263a8e4288c8e0bbbbac9d9964df52be8cb872b75f8f5c5bb549915d25c5017cf604ca3f2c4
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/lib/rspec_proxypac.rb
CHANGED
@@ -3,23 +3,24 @@ require 'uri'
|
|
3
3
|
|
4
4
|
RSpec::Matchers.define :find_proxy do |expected|
|
5
5
|
match do |pacfile|
|
6
|
-
pac =
|
6
|
+
pac = RspecProxypac::Pac.pac(pacfile)
|
7
7
|
@result_string = pac.find(@target_url)
|
8
8
|
@result_string == expected
|
9
9
|
end
|
10
10
|
|
11
11
|
chain :for do |url|
|
12
12
|
@target_url = url
|
13
|
-
@chain_string = "for #{url}"
|
13
|
+
@chain_string = " for #{url}"
|
14
14
|
end
|
15
15
|
|
16
16
|
description do
|
17
|
-
"
|
17
|
+
"find proxy '#{@result_string}'#{@chain_string}"
|
18
18
|
end
|
19
19
|
|
20
20
|
failure_message do
|
21
|
-
s = "expected to find proxy '#{@chain_string}
|
22
|
-
s
|
21
|
+
s = "expected to find proxy '#{expected}'#{@chain_string}, but did not."
|
22
|
+
s << "\n expected: #{expected}"
|
23
|
+
s << "\n actual: #{@result_string}"
|
23
24
|
end
|
24
25
|
|
25
26
|
failure_message_when_negated do
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rspec_proxypac'
|
2
|
+
require 'pac'
|
3
|
+
|
4
|
+
# Easily test your proxy.pac with RSpec.
|
5
|
+
module RspecProxypac
|
6
|
+
# Utility class
|
7
|
+
class Pac
|
8
|
+
@pacs = {}
|
9
|
+
class << self
|
10
|
+
attr_accessor :pacs
|
11
|
+
end
|
12
|
+
def self.pac(pacfile)
|
13
|
+
# cache pacfile
|
14
|
+
pacs[pacfile] ||= PAC.load(pacfile)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-proxypac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Ota
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -130,12 +130,16 @@ extensions: []
|
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
132
|
- ".gitignore"
|
133
|
+
- ".rspec"
|
134
|
+
- ".rubocop.yml"
|
135
|
+
- ".travis.yml"
|
133
136
|
- Gemfile
|
134
137
|
- LICENSE.txt
|
135
138
|
- README.md
|
136
139
|
- Rakefile
|
137
140
|
- lib/rspec_proxypac.rb
|
138
141
|
- lib/rspec_proxypac/find_proxy.rb
|
142
|
+
- lib/rspec_proxypac/pac.rb
|
139
143
|
- lib/rspec_proxypac/util.rb
|
140
144
|
- lib/rspec_proxypac/version.rb
|
141
145
|
- rspec-proxypac.gemspec
|