rspec-proxypac 0.1.0 → 0.1.1

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: 1909bb1dce3b543dc6f31549e61fe241640b0dad
4
- data.tar.gz: 3599e7c798eef68118ddec9158bf99bd3a237fe0
3
+ metadata.gz: c9e8eb584b7daabc3f4e1ac08687dc03db52855a
4
+ data.tar.gz: df58d62c132ba22d2df0be4b9b3c5e434486d859
5
5
  SHA512:
6
- metadata.gz: b77e69bd49d0e3d8160162d746abc82eccd25aa550429780cfcfbd44bd7c3ac6aff0b00ecc876a271ad314fbeda9b083383aa23b6552395dff1357e0463a85e5
7
- data.tar.gz: 19422d8c4b9ceff0db7091fd2069312470d0b2958a3742539f7c4edcf11c907ecf79837af7777321d41c53dfa152107c8c5a2d0515d5d268a237e9fc15394e21
6
+ metadata.gz: b866d0d278dc35238a9d713c6be93695a4694ddc2c1224407b9b6778f8d0b19784fea976d029a75cb6ad1e0cd3535aa6810007e0fe2d8a76a047c0a45b06607a
7
+ data.tar.gz: bd3b3bfcc453c9f9a7e5bde07773242e10fc3c917fdfa3c6eae9a263a8e4288c8e0bbbbac9d9964df52be8cb872b75f8f5c5bb549915d25c5017cf604ca3f2c4
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
@@ -0,0 +1,7 @@
1
+ # Avoid methods longer than 10 lines of code
2
+ MethodLength:
3
+ Enabled: false
4
+
5
+ # Avoid classes longer than 100 lines of code
6
+ ClassLength:
7
+ Enabled: false
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ cache: bundler
3
+
4
+ rvm:
5
+ - 2.0.0
6
+ - 2.1.2
@@ -2,5 +2,4 @@ require 'rspec_proxypac/version'
2
2
 
3
3
  require 'rspec_proxypac/util'
4
4
  require 'rspec_proxypac/find_proxy'
5
-
6
- require 'pac'
5
+ require 'rspec_proxypac/pac'
@@ -3,23 +3,24 @@ require 'uri'
3
3
 
4
4
  RSpec::Matchers.define :find_proxy do |expected|
5
5
  match do |pacfile|
6
- pac = PAC.load(pacfile)
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
- "should find proxy '#{@result_string}' #{@chain_string}"
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}', but did not."
22
- s + "\n#{@result_string}"
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
@@ -1,4 +1,4 @@
1
1
  # Easily test your proxy.pac with RSpec.
2
2
  module RspecProxypac
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  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.0
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-25 00:00:00.000000000 Z
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