Skip to content

Commit e03ef04

Browse files
committed
fixup! Allow disabling of all network accesses
1 parent fd40437 commit e03ef04

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

History.markdown

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
## HEAD
2-
3-
## Minor Enhancements
4-
5-
* Disable network related features if the env var `PAGES_DISABLE_NETWORK` is set
6-
71
## 2.16.1 / 2023-12-22
82

93
### Bug Fixes

spec/client_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,21 @@
3838
subject.contributors("jekyll/github-metadata")
3939
end.to raise_error(described_class::BadCredentialsError)
4040
end
41+
42+
before { ENV["PAGES_DISABLE_NETWORK"] = nil }
43+
44+
it "supresses network accesses if requested" do
45+
WebMock.disable_net_connect!
46+
47+
ENV["PAGES_DISABLE_NETWORK"] = "1"
48+
expect(subject.contributors("jekyll/github-metadata")).to be(false)
49+
end
50+
51+
it "allows network accesses by default" do
52+
WebMock.disable_net_connect!
53+
54+
expect do
55+
subject.contributors("jekyll/github-metadata")
56+
end.to raise_error(WebMock::NetConnectNotAllowedError)
57+
end
4158
end

0 commit comments

Comments
 (0)