Created
June 15, 2018 13:38
-
-
Save ekohl/f86924dc00197890a831d57fd6329324 to your computer and use it in GitHub Desktop.
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
describe MetadataJsonLint do | |
describe '.validate_requirements!' do | |
context 'empty requirements' do | |
let :requirements do | |
[] | |
end | |
it { expect { described_class.validate_requirements!(requirements) }.not_to raise_error } | |
end | |
context 'with pe' do | |
let :requirements do | |
[ | |
{'name' => 'pe'} | |
] | |
end | |
it do | |
expect(described_class).to receive('warn').with(:requirements, "The 'pe' requirement is no longer supported by the Forge.") | |
expect { described_class.validate_requirements!(requirements) }.not_to raise_error | |
end | |
end | |
context 'with invalid requirement' do | |
let :requirements do | |
[ | |
{'version_requirement' => 'a'} | |
] | |
end | |
it do | |
expect(described_class).to receive('error').with(:dependencies, "Invalid 'version_requirement' field in metadata.json: Unparsable version range: \"a\"") | |
expect { described_class.validate_requirements!(requirements) }.not_to raise_error | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment