-
Notifications
You must be signed in to change notification settings - Fork 87
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 #312 from github/storeconfigs-backend
Add ability to set storeconfig_backends
- Loading branch information
Showing
6 changed files
with
42 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
# Set storeconfigs (integration with PuppetDB for collected resources) | ||
# @param parser [OptionParser object] The OptionParser argument | ||
# @param options [Hash] Options hash being constructed; this is modified in this method. | ||
OctocatalogDiff::Cli::Options::Option.newoption(:storeconfigs) do | ||
has_weight 220 | ||
|
||
def parse(parser, options) | ||
parser.on('--storeconfigs-backend TERMINUS', 'Set the terminus used for storeconfigs') do |x| | ||
options[:storeconfigs_backend] = x | ||
end | ||
end | ||
end |
12 changes: 12 additions & 0 deletions
12
spec/octocatalog-diff/tests/cli/options/storeconfigs_backend_spec.rb
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,12 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../options_helper' | ||
|
||
describe OctocatalogDiff::Cli::Options do | ||
describe '#opt_storeconfigs_backend' do | ||
it 'should accept all valid arguments' do | ||
result = run_optparse(['--storeconfigs-backend', 'puppetdb']) | ||
expect(result[:storeconfigs_backend]).to eq('puppetdb') | ||
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