tcr 0.4.0 → 0.4.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/.github/dependabot.yml +10 -0
- data/.github/workflows/tcr.yml +1 -1
- data/Gemfile +1 -0
- data/lib/tcr/version.rb +1 -1
- data/lib/tcr.rb +2 -2
- data/spec/tcr_spec.rb +14 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2218fe9a2c9cb0c2c5c9d92f1e22c0a537985d45a37ca97b25e75b132984225c
|
4
|
+
data.tar.gz: d6db4c0a7d82b531f3517f2fa47a3e12cd2f530d3442dda6cbfca0fd2b9ba50f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c274ad83970a61cb4c15e27d399a8d2efd099463fa2fa85b69c6b193b77f64f95d60effedb01f7c88641ac49ad24c5e3039317aec19ec874a7641f4173d8a208
|
7
|
+
data.tar.gz: 19d781dacbba3de87fe11e94d3d0598f94ee47976eef94dacb37688dfa45c3375329397076fa3ef2be327c22fdd985a29e1a5f37a245439b68be69d25d41055d
|
data/.github/workflows/tcr.yml
CHANGED
data/Gemfile
CHANGED
data/lib/tcr/version.rb
CHANGED
data/lib/tcr.rb
CHANGED
@@ -90,11 +90,11 @@ class Socket
|
|
90
90
|
class << self
|
91
91
|
alias_method :real_tcp, :tcp
|
92
92
|
|
93
|
-
def tcp(host, port, *
|
93
|
+
def tcp(host, port, *local_args, **timeout_opts)
|
94
94
|
if TCR.configuration.hook_tcp_ports.include?(port)
|
95
95
|
TCR::RecordableTCPSocket.new(host, port, TCR.cassette)
|
96
96
|
else
|
97
|
-
real_tcp(host, port, *
|
97
|
+
real_tcp(host, port, *local_args, **timeout_opts)
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|
data/spec/tcr_spec.rb
CHANGED
@@ -523,4 +523,18 @@ RSpec.describe TCR do
|
|
523
523
|
end
|
524
524
|
}.not_to raise_error
|
525
525
|
end
|
526
|
+
|
527
|
+
context "when port is not in hook_tcp_ports" do
|
528
|
+
it "it honors Socket.tcp keyword arguments" do
|
529
|
+
TCR.configure { |c|
|
530
|
+
c.hook_tcp_ports = [8080]
|
531
|
+
c.cassette_library_dir = "."
|
532
|
+
}
|
533
|
+
|
534
|
+
TCR.use_cassette("test") do
|
535
|
+
sock = Socket.tcp("google.com", 80, connect_timeout: 1, resolv_timeout: 1)
|
536
|
+
expect(sock).to be_a(Socket)
|
537
|
+
end
|
538
|
+
end
|
539
|
+
end
|
526
540
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tcr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Forman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: TCR is a lightweight VCR for TCP sockets.
|
14
14
|
email:
|
@@ -18,6 +18,7 @@ extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- ".github/CODEOWNERS"
|
21
|
+
- ".github/dependabot.yml"
|
21
22
|
- ".github/workflows/tcr.yml"
|
22
23
|
- ".gitignore"
|
23
24
|
- Gemfile
|
@@ -63,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
64
|
- !ruby/object:Gem::Version
|
64
65
|
version: '0'
|
65
66
|
requirements: []
|
66
|
-
rubygems_version: 3.4.
|
67
|
+
rubygems_version: 3.4.19
|
67
68
|
signing_key:
|
68
69
|
specification_version: 4
|
69
70
|
summary: TCR is a lightweight VCR for TCP sockets.
|