Options: a class to wrap Hash-accessing options choices
- protects against bad names
This commit is contained in:
16
spec/unit/options_spec.rb
Normal file
16
spec/unit/options_spec.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# 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
|
||||
@@ -85,10 +85,6 @@ describe GitHubChangelogGenerator::Reader do
|
||||
context "angular.js.md" do
|
||||
it { is_expected.to be_an(Array) }
|
||||
it { is_expected.not_to be_empty }
|
||||
it do
|
||||
pending("Implement heading_level for parser.")
|
||||
expect(subject.count).to eq(134)
|
||||
end
|
||||
# it do
|
||||
# pending('Implement heading_level for parser.')
|
||||
# expect(subject.first).to include('version' => '1.4.0-beta.6 cookie-liberation')
|
||||
|
||||
Reference in New Issue
Block a user