Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f05eb54e
Commit
f05eb54e
authored
Jan 31, 2020
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add anchors to spec DNS stubs
parent
20c9d7f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
spec/support/helpers/dns_helpers.rb
spec/support/helpers/dns_helpers.rb
+2
-2
No files found.
spec/support/helpers/dns_helpers.rb
View file @
f05eb54e
...
...
@@ -17,13 +17,13 @@ module DnsHelpers
end
def
stub_invalid_dns!
allow
(
Addrinfo
).
to
receive
(
:getaddrinfo
).
with
(
/
foobar\.\w|(\d{1,3}\.){4,}\d{1,3}
/i
,
anything
,
nil
,
:STREAM
)
do
allow
(
Addrinfo
).
to
receive
(
:getaddrinfo
).
with
(
/
\Afoobar\.\w|(\d{1,3}\.){4,}\d{1,3}\z
/i
,
anything
,
nil
,
:STREAM
)
do
raise
SocketError
.
new
(
"getaddrinfo: Name or service not known"
)
end
end
def
permit_local_dns!
local_addresses
=
/
(127|10)\.0\.0\.\d{1,3}|(192\.168|172\.16)\.\d{1,3}\.\d{1,3}|0\.0\.0\.0|localhost
/i
local_addresses
=
/
\A(127|10)\.0\.0\.\d{1,3}|(192\.168|172\.16)\.\d{1,3}\.\d{1,3}|0\.0\.0\.0|localhost\z
/i
allow
(
Addrinfo
).
to
receive
(
:getaddrinfo
).
with
(
local_addresses
,
anything
,
nil
,
:STREAM
).
and_call_original
allow
(
Addrinfo
).
to
receive
(
:getaddrinfo
).
with
(
local_addresses
,
anything
,
nil
,
:STREAM
,
anything
,
anything
).
and_call_original
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment