github-changelog-generator/spec/unit/options_spec.rb
Olle Jonsson 43a6e49055 Options: a class to wrap Hash-accessing options choices
- protects against bad names
2016-10-05 23:10:21 +02:00

17 lines
462 B
Ruby

# frozen_string_literal: true
describe GitHubChangelogGenerator::Options do
it 'can be instantiated with defaults' do
expect(described_class.new(user: 'olle')[:user]).to eq('olle')
end
it 'disallows unknown option names' do
expect {
described_class.new(
git_remote: 'origin',
strength: 'super-strength',
wisdom: 'deep'
)
}.to raise_error(ArgumentError, "Unsupported options [:strength, :wisdom]")
end
end