-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from jekyll/up-to-speed
Bring this gem up-to-date with latest GitHub Pages metadata
- Loading branch information
Showing
9 changed files
with
173 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe(Jekyll::GitHubMetadata::GHPMetadataGenerator) do | ||
let(:overrides) { {"repository" => "jekyll/another-repo"} } | ||
let(:config) { Jekyll::Configuration::DEFAULTS.merge(overrides) } | ||
let(:site) { Jekyll::Site.new config } | ||
subject { described_class.new(site.config) } | ||
|
||
context "with no repository set" do | ||
before(:each) do | ||
site.config.delete('repository') | ||
ENV['PAGES_REPO_NWO'] = nil | ||
end | ||
|
||
it "raises a NoRepositoryError" do | ||
expect(-> { | ||
subject.nwo(site) | ||
}).to raise_error(Jekyll::GitHubMetadata::NoRepositoryError) | ||
end | ||
end | ||
|
||
context "with PAGES_REPO_NWO and site.repository set" do | ||
before(:each) { ENV['PAGES_REPO_NWO'] = "jekyll/some-repo" } | ||
|
||
it "uses the value from PAGES_REPO_NWO" do | ||
expect(subject.nwo(site)).to eql("jekyll/some-repo") | ||
end | ||
end | ||
|
||
context "with only site.repository set" do | ||
before(:each) { ENV['PAGES_REPO_NWO'] = nil } | ||
|
||
it "uses the value from site.repository" do | ||
expect(subject.nwo(site)).to eql("jekyll/another-repo") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters