rspec-ssltls 0.0.8 → 0.0.9

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: 670209d5f9d2bb9fafd5711d927641df20136381
4
- data.tar.gz: 589620f5cdbf716fe7ed791613605531d92dc202
3
+ metadata.gz: 2ebcd4b75c0a3963f4f7b3caef05d5249485723b
4
+ data.tar.gz: 72c2033ba56047c24061bff3e8498fadb454e9ec
5
5
  SHA512:
6
- metadata.gz: 087229fa195509fcf3c0d10a81ffc1a472491ee574463f6f87d60f99d7714e4aa93b3628076415710cb63bc9862c70adf9a17b051f3ec0e9e3d54ccec1f037bb
7
- data.tar.gz: 925215f039568cef80cf861ea44389060f32cea32bc363e8bf8347143620632b7fa4e346027010208533f9735dbf6b8c467b03c0ace7f594603b9be06954a479
6
+ metadata.gz: c5e147adb3f08044bc1d53e931f8fdd27711c065c273f7b3d54a8b1a24b3535d086d6a47921d257171fe824e67ff417116b02a8f012f7f4f9612cc96bbb794da
7
+ data.tar.gz: 3fc227ae337bcd54d0e22525ffc9186a7d5e61f889dd9a0f63112b9d6b74f01763d1ddbf8f185b063d3760f2732f8581256c6e128774b4766a86f57612a94c6e
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
data/.rubocop.yml CHANGED
File without changes
data/.travis.yml CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
@@ -51,7 +51,7 @@ describe 'www.example.com:443' do
51
51
  it do
52
52
  is_expected.to have_certificate
53
53
  .subject(CN: '*.example.com').valid_at('2020/09/12 19:00:05 JST')
54
- .via_proxy('http://user:pass@proxy.example.com/')
54
+ .via_proxy('http://user:pass@proxy.example.com:3128/')
55
55
  end
56
56
  end
57
57
  ```
data/Rakefile CHANGED
File without changes
data/lib/rspec_ssltls.rb CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -24,7 +24,7 @@ module RspecSsltls
24
24
  if options[:proxy]
25
25
  proxy_uri = build_uri(options[:proxy])
26
26
  proxy_server = Net::SSH::Proxy::HTTP.new(proxy_uri.host,
27
- proxy_uri.host,
27
+ proxy_uri.port,
28
28
  user: proxy_uri.user,
29
29
  password: proxy_uri.password)
30
30
  proxy_server.open(uri.host, uri.port)
@@ -1,4 +1,4 @@
1
1
  # Easily test your SSL/TLS with RSpec.
2
2
  module RspecSsltls
3
- VERSION = '0.0.8'
3
+ VERSION = '0.0.9'
4
4
  end
data/rspec-ssltls.gemspec CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,58 @@
1
+ require 'spec_helper'
2
+ require 'rspec_ssltls'
3
+
4
+ describe RspecSsltls::Util do
5
+ describe '#self.open_socket' do
6
+ before :each do
7
+ proxy = double('proxy')
8
+ allow(proxy).to receive(:open).and_return(:proxy)
9
+ allow(Net::SSH::Proxy::HTTP).to receive(:new).and_return(proxy)
10
+ allow(TCPSocket).to receive(:open).and_return(:direct)
11
+ end
12
+
13
+ context 'when options[:proxy] specified' do
14
+ let(:uri) { URI.parse('https://www.example.com/') }
15
+ let(:proxy_url) { 'http://proxy.example.com' }
16
+
17
+ it 'should connect target via specified proxy server' do
18
+ socket = described_class.open_socket(uri, proxy: proxy_url)
19
+ expect(socket).to eq(:proxy)
20
+ end
21
+ end
22
+
23
+ context 'when options[:proxy] is nil' do
24
+ let(:uri) { URI.parse('https://www.example.com/') }
25
+ let(:proxy_url) { nil }
26
+
27
+ it 'should connect target directly' do
28
+ socket = described_class.open_socket(uri, proxy: proxy_url)
29
+ expect(socket).to eq(:direct)
30
+ end
31
+ end
32
+ end
33
+
34
+ describe '#self.build_uri' do
35
+ context 'when String is given' do
36
+ let(:source) { 'http://proxy.example.com:3128/' }
37
+ it do
38
+ uri = described_class.send(:build_uri, source)
39
+ expect(uri).to eq URI.parse('http://proxy.example.com:3128/')
40
+ end
41
+ context 'when scheme is missing' do
42
+ let(:source) { 'proxy.example.com' }
43
+ it 'should complete http:// as default scheme' do
44
+ uri = described_class.send(:build_uri, source)
45
+ expect(uri).to eq URI.parse('http://proxy.example.com:80/')
46
+ end
47
+ end
48
+ end
49
+
50
+ context 'when not String is given' do
51
+ let(:source) { URI.parse('http://proxy.example.com/') }
52
+ it 'should return same object as given' do
53
+ uri = described_class.send(:build_uri, source)
54
+ expect(uri) == source
55
+ end
56
+ end
57
+ end
58
+ end
data/spec/spec_helper.rb CHANGED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-ssltls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - OTA Hiroshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-24 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
@@ -134,6 +134,7 @@ files:
134
134
  - spec/rspec_ssltls/rspec_ssltls_spec.rb
135
135
  - spec/rspec_ssltls/support_cipher_spec.rb
136
136
  - spec/rspec_ssltls/support_protocol_spec.rb
137
+ - spec/rspec_ssltls/util_spec.rb
137
138
  - spec/spec_helper.rb
138
139
  homepage: https://github.com/otahi/rspec-ssltls
139
140
  licenses:
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
156
  version: '0'
156
157
  requirements: []
157
158
  rubyforge_project:
158
- rubygems_version: 2.4.5
159
+ rubygems_version: 2.2.2
159
160
  signing_key:
160
161
  specification_version: 4
161
162
  summary: Easily test your SSL/TLS with RSpec.
@@ -164,4 +165,5 @@ test_files:
164
165
  - spec/rspec_ssltls/rspec_ssltls_spec.rb
165
166
  - spec/rspec_ssltls/support_cipher_spec.rb
166
167
  - spec/rspec_ssltls/support_protocol_spec.rb
168
+ - spec/rspec_ssltls/util_spec.rb
167
169
  - spec/spec_helper.rb