-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create have_a_valid_manifest matcher
- Loading branch information
1 parent
5a1543b
commit b151280
Showing
4 changed files
with
34 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
describe 'manifest', chdir: false do | ||
let(:manifest_lines) do | ||
File.readlines('nanoc-external.manifest').map(&:chomp).reject(&:empty?) | ||
end | ||
|
||
let(:gemspec_lines) do | ||
gemspec = eval(File.read('nanoc-external.gemspec'), binding, 'nanoc-external.gemspec') | ||
gemspec.files | ||
end | ||
|
||
it 'contains all files in gemspec' do | ||
missing_from_manifest = gemspec_lines - manifest_lines | ||
expect(missing_from_manifest).to be_empty, "Found files that appear in the gemspec, but not in the manifest: #{missing_from_manifest.join(', ')}" | ||
end | ||
|
||
it 'contains no files not in gemspec' do | ||
extra_in_manifest = manifest_lines - gemspec_lines | ||
expect(extra_in_manifest).to be_empty, "Found files that appear in the manifest, but not in the gemspec: #{extra_in_manifest.join(', ')}" | ||
example do | ||
expect('nanoc-external').to have_a_valid_manifest | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
describe 'manifest', chdir: false do | ||
let(:manifest_lines) do | ||
File.readlines('nanoc-live.manifest').map(&:chomp).reject(&:empty?) | ||
end | ||
|
||
let(:gemspec_lines) do | ||
gemspec = eval(File.read('nanoc-live.gemspec'), binding, 'nanoc-live.gemspec') | ||
gemspec.files | ||
end | ||
|
||
it 'contains all files in gemspec' do | ||
missing_from_manifest = gemspec_lines - manifest_lines | ||
expect(missing_from_manifest).to be_empty, "Found files that appear in the gemspec, but not in the manifest: #{missing_from_manifest.join(', ')}" | ||
end | ||
|
||
it 'contains no files not in gemspec' do | ||
extra_in_manifest = manifest_lines - gemspec_lines | ||
expect(extra_in_manifest).to be_empty, "Found files that appear in the manifest, but not in the gemspec: #{extra_in_manifest.join(', ')}" | ||
example do | ||
expect('nanoc-live').to have_a_valid_manifest | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
describe 'manifest', chdir: false do | ||
let(:manifest_lines) do | ||
File.readlines('nanoc.manifest').map(&:chomp).reject(&:empty?) | ||
end | ||
|
||
let(:gemspec_lines) do | ||
gemspec = eval(File.read('nanoc.gemspec'), binding, 'nanoc.gemspec') | ||
gemspec.files | ||
end | ||
|
||
it 'contains all files in gemspec' do | ||
missing_from_manifest = gemspec_lines - manifest_lines | ||
expect(missing_from_manifest).to be_empty, "Found files that appear in the gemspec, but not in the manifest: #{missing_from_manifest.join(', ')}" | ||
end | ||
|
||
it 'contains no files not in gemspec' do | ||
extra_in_manifest = manifest_lines - gemspec_lines | ||
expect(extra_in_manifest).to be_empty, "Found files that appear in the manifest, but not in the gemspec: #{extra_in_manifest.join(', ')}" | ||
example do | ||
expect('nanoc').to have_a_valid_manifest | ||
end | ||
end |