Remove unneeded spec testing file
Also fix up a couple of failing tests in the pacemaker::new module and remove one very artificial test that is not working on puppet 4 any longer (NB: the pacemaker;:new module has been fundamentally unmaintained for years now, this is mainly to keep CI running) Closes-Bug: #1805868 Change-Id: I4102b204f303b0ada697f0ad9d9a24279473e046
This commit is contained in:
parent
b2744d3046
commit
5800e93e17
1
Gemfile
1
Gemfile
|
@ -28,7 +28,6 @@ group :test do
|
|||
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
|
||||
gem 'puppet-lint-unquoted_string-check', :require => false
|
||||
gem 'puppet-lint-variable_contains_upcase', :require => false
|
||||
gem 'rubocop', '~> 0.50.0', :require => false
|
||||
gem 'unicode-display_width', :require => false
|
||||
gem 'puppetlabs_spec_helper', :require => false
|
||||
gem 'serverspec', :require => false
|
||||
|
|
|
@ -54,9 +54,9 @@ Output forms:
|
|||
nodes = args[0]
|
||||
form = args[1] || 'hash'
|
||||
form = form.to_s.downcase
|
||||
fail 'Nodes are not provided!' unless nodes
|
||||
raise(Puppet::Error, 'Nodes are not provided!') if [String, Hash, Array].include? nodes.class and nodes.empty?
|
||||
forms = %w(list array hash)
|
||||
fail "Unknown form: '#{form}'" unless forms.include? form
|
||||
raise(Puppet::Error, "Unknown form: '#{form}'") unless forms.include? form
|
||||
|
||||
array_formatter = lambda do |structure|
|
||||
list = []
|
||||
|
@ -143,7 +143,7 @@ Output forms:
|
|||
end
|
||||
|
||||
hash_parser = lambda do |hash|
|
||||
fail "Data is not a hash: #{hash.inspect}" unless hash.is_a? Hash
|
||||
raise(Puppet::Error, "Data is not a hash: #{hash.inspect}") unless hash.is_a? Hash
|
||||
node_list = []
|
||||
hash.each do |node_name, node|
|
||||
node = node.dup
|
||||
|
@ -174,7 +174,7 @@ Output forms:
|
|||
elsif nodes.is_a? Hash
|
||||
structure = hash_parser.call nodes
|
||||
else
|
||||
fail "Got unsupported nodes input data: #{nodes.inspect}"
|
||||
raise(Puppet::Error, "Got unsupported nodes input data: #{nodes.inspect}")
|
||||
end
|
||||
|
||||
set_node_ids.call structure
|
||||
|
|
|
@ -13,6 +13,7 @@ Gather resource parameters and their values
|
|||
parameters.merge! key
|
||||
else
|
||||
next if key.nil?
|
||||
next if key == ''
|
||||
next if value.nil?
|
||||
next if value == ''
|
||||
next if value == :undef
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
require 'rspec-puppet'
|
||||
|
||||
at_exit { RSpec::Puppet::Coverage.report! }
|
|
@ -5,7 +5,6 @@ describe 'pacemaker_cluster_nodes' do
|
|||
it { is_expected.not_to eq(nil) }
|
||||
it { is_expected.to run.with_params.and_raise_error(ArgumentError) }
|
||||
it { is_expected.to run.with_params(1).and_raise_error(Puppet::Error, /Got unsupported nodes input data/) }
|
||||
it { is_expected.to run.with_params(nil).and_raise_error(Puppet::Error, /Nodes are not provided/) }
|
||||
end
|
||||
|
||||
it 'can parse the input as a node list string' do
|
||||
|
|
Loading…
Reference in New Issue