File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
lib/jekyll-github-metadata Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def repo_pages_html_url_preview?
53
53
end
54
54
55
55
def github_url
56
- if dotcom?
56
+ if dotcom? || github_hostname == "github.com"
57
57
"https://github.com" . freeze
58
58
else
59
59
"#{ scheme } ://#{ github_hostname } "
Original file line number Diff line number Diff line change 158
158
end
159
159
end
160
160
end
161
+
162
+ context "in development" do
163
+ let ( :nwo ) { "jekyll/jekyll" }
164
+
165
+ it "github.com repo URL always https" do
166
+ with_env ( {
167
+ "GITHUB_HOSTNAME" => "github.com" ,
168
+ "PAGES_ENV" => "development"
169
+ } ) do
170
+ expect ( repo . repository_url ) . to eql ( "https://github.com/#{ nwo } " )
171
+ end
172
+ end
173
+
174
+ it "non-github.com repo URL always http" do
175
+ with_env ( {
176
+ "GITHUB_HOSTNAME" => "xyz.example" ,
177
+ "PAGES_ENV" => "development"
178
+ } ) do
179
+ expect ( repo . repository_url ) . to eql ( "http://xyz.example/#{ nwo } " )
180
+ end
181
+ end
182
+ end
161
183
end
162
184
end
You can’t perform that action at this time.
0 commit comments