|
12 | 12 |
|
13 | 13 | context '.parse' do |
14 | 14 | it 'raises an error if an invalid option was specified' do |
15 | | - expect { PuppetCheck::CLI.parse(%w[-s -asdf foo]) }.to raise_error(OptionParser::InvalidOption) |
| 15 | + expect { PuppetCheck::CLI.send(:parse, %w[-s -asdf foo]) }.to raise_error(OptionParser::InvalidOption) |
16 | 16 | end |
17 | 17 |
|
18 | 18 | it 'allows fail on warnings, style, smoke, and regression checks to be enabled' do |
19 | | - expect(PuppetCheck::CLI.parse(%w[--fail-on-warnings -s -r --smoke foo])).to include(fail_on_warnings: true, style: true, smoke: true, regression: true) |
| 19 | + expect(PuppetCheck::CLI.send(:parse, %w[--fail-on-warnings -s -r --smoke foo])).to include(fail_on_warnings: true, style: true, smoke: true, regression: true) |
20 | 20 | end |
21 | 21 |
|
22 | 22 | it 'correctly parser EYAML options' do |
23 | | - expect(PuppetCheck::CLI.parse(%w[--public pub.pem --private priv.pem])).to include(public: 'pub.pem', private: 'priv.pem') |
| 23 | + expect(PuppetCheck::CLI.send(:parse, %w[--public pub.pem --private priv.pem])).to include(public: 'pub.pem', private: 'priv.pem') |
24 | 24 | end |
25 | 25 |
|
26 | 26 | it 'correctly parses a formatting option' do |
27 | | - expect(PuppetCheck::CLI.parse(%w[-o text])).to include(output_format: 'text') |
| 27 | + expect(PuppetCheck::CLI.send(:parse, %w[-o text])).to include(output_format: 'text') |
28 | 28 | end |
29 | 29 |
|
30 | 30 | it 'correctly parses octocatalog-diff options' do |
31 | | - expect(PuppetCheck::CLI.parse(%w[--octoconfig config.cfg.rb --octonodes server1,server2])).to include(octoconfig: 'config.cfg.rb', octonodes: %w[server1 server2]) |
| 31 | + expect(PuppetCheck::CLI.send(:parse, %w[--octoconfig config.cfg.rb --octonodes server1,server2])).to include(octoconfig: 'config.cfg.rb', octonodes: %w[server1 server2]) |
32 | 32 | end |
33 | 33 |
|
34 | 34 | it 'correctly parses PuppetLint arguments' do |
35 | | - expect(PuppetCheck::CLI.parse(%w[--puppet-lint puppetlint-arg-one,puppetlint-arg-two foo])).to include(puppetlint_args: ['--puppetlint-arg-one', '--puppetlint-arg-two']) |
| 35 | + expect(PuppetCheck::CLI.send(:parse, %w[--puppet-lint puppetlint-arg-one,puppetlint-arg-two foo])).to include(puppetlint_args: ['--puppetlint-arg-one', '--puppetlint-arg-two']) |
36 | 36 | end |
37 | 37 |
|
38 | 38 | it 'correctly loads a .puppet-lint.rc' do |
39 | | - expect(PuppetCheck::CLI.parse(%W[-c #{fixtures_dir}/manifests/.puppet-lint.rc])).to include(puppetlint_args: ['--puppetlint-arg-one', '--puppetlint-arg-two']) |
| 39 | + expect(PuppetCheck::CLI.send(:parse, %W[-c #{fixtures_dir}/manifests/.puppet-lint.rc])).to include(puppetlint_args: ['--puppetlint-arg-one', '--puppetlint-arg-two']) |
40 | 40 | end |
41 | 41 |
|
42 | 42 | it 'correctly parses Rubocop arguments' do |
43 | | - expect(PuppetCheck::CLI.parse(%w[--rubocop rubocop-arg-one,rubocop-arg-two foo])).to include(rubocop_args: ['--except', 'rubocop-arg-one,rubocop-arg-two']) |
| 43 | + expect(PuppetCheck::CLI.send(:parse, %w[--rubocop rubocop-arg-one,rubocop-arg-two foo])).to include(rubocop_args: ['--except', 'rubocop-arg-one,rubocop-arg-two']) |
44 | 44 | end |
45 | 45 |
|
46 | 46 | it 'correctly parses multiple sets of arguments' do |
47 | | - expect(PuppetCheck::CLI.parse(%w[-s --puppet-lint puppetlint-arg-one,puppetlint-arg-two --rubocop rubocop-arg-one,rubocop-arg-two foo])).to include(style: true, puppetlint_args: ['--puppetlint-arg-one', '--puppetlint-arg-two'], rubocop_args: ['--except', 'rubocop-arg-one,rubocop-arg-two']) |
| 47 | + expect(PuppetCheck::CLI.send(:parse, %w[-s --puppet-lint puppet-lint-arg-one,puppet-lint-arg-two --rubocop rubocop-arg-one,rubocop-arg-two foo])).to include(style: true, puppetlint_args: ['--puppet-lint-arg-one', '--puppet-lint-arg-two'], rubocop_args: ['--except', 'rubocop-arg-one,rubocop-arg-two']) |
48 | 48 | end |
49 | 49 | end |
50 | 50 | end |
0 commit comments