(maint) Add file_concat and fix rspec warnings

This fixes the file_concat dependency issue postgresql module has brought in,
plus removes some deprecation warnings from our rspec tests.

I've also bumped rspec-puppet as well, while I was at it.

Signed-off-by: Ken Barber <ken@bob.sh>
This commit is contained in:
Ken Barber 2015-04-21 14:10:41 +01:00
parent 6c9c365847
commit 332ec352f9
3 changed files with 7 additions and 6 deletions

View file

@ -6,5 +6,6 @@ fixtures:
firewall: 'git://github.com/puppetlabs/puppetlabs-firewall.git' firewall: 'git://github.com/puppetlabs/puppetlabs-firewall.git'
apt: 'git://github.com/puppetlabs/puppetlabs-apt.git' apt: 'git://github.com/puppetlabs/puppetlabs-apt.git'
concat: 'git://github.com/puppetlabs/puppetlabs-concat.git' concat: 'git://github.com/puppetlabs/puppetlabs-concat.git'
file_concat: 'git://github.com/electrical/puppet-lib-file_concat.git'
symlinks: symlinks:
puppetdb: '#{source_dir}' puppetdb: '#{source_dir}'

View file

@ -5,7 +5,7 @@ group :development, :test do
gem 'puppetlabs_spec_helper', :require => false gem 'puppetlabs_spec_helper', :require => false
# Pinning due to bug in newer rspec with Ruby 1.8.7 # Pinning due to bug in newer rspec with Ruby 1.8.7
gem 'rspec-core', '3.1.7' gem 'rspec-core', '3.1.7'
gem 'rspec-puppet', '~> 1.0' gem 'rspec-puppet', '~> 2.0'
gem 'puppet-lint', '~> 1.1' gem 'puppet-lint', '~> 1.1'
gem 'metadata-json-lint' gem 'metadata-json-lint'
end end

View file

@ -28,13 +28,13 @@ describe 'Puppet::Util::PuppetdbValidator' do
it 'returns true if connection succeeds' do it 'returns true if connection succeeds' do
validator = Puppet::Util::PuppetdbValidator.new('mypuppetdb.com', 8081) validator = Puppet::Util::PuppetdbValidator.new('mypuppetdb.com', 8081)
validator.attempt_connection.should be true expect(validator.attempt_connection).to be true
end end
it 'should still validate without ssl' do it 'should still validate without ssl' do
Puppet[:configtimeout] = 2 Puppet[:configtimeout] = 2
validator = Puppet::Util::PuppetdbValidator.new('mypuppetdb.com', 8080, false) validator = Puppet::Util::PuppetdbValidator.new('mypuppetdb.com', 8080, false)
validator.attempt_connection.should be true expect(validator.attempt_connection).to be true
end end
it 'returns false and issues an appropriate notice if connection is refused' do it 'returns false and issues an appropriate notice if connection is refused' do
@ -42,7 +42,7 @@ describe 'Puppet::Util::PuppetdbValidator' do
puppetdb_port = 8080 puppetdb_port = 8080
validator = Puppet::Util::PuppetdbValidator.new(puppetdb_server, puppetdb_port) validator = Puppet::Util::PuppetdbValidator.new(puppetdb_server, puppetdb_port)
Puppet.expects(:notice).with("Unable to connect to puppetdb server (https://#{puppetdb_server}:#{puppetdb_port}): Connection refused") Puppet.expects(:notice).with("Unable to connect to puppetdb server (https://#{puppetdb_server}:#{puppetdb_port}): Connection refused")
validator.attempt_connection.should be false expect(validator.attempt_connection).to be false
end end
it 'returns false and issues an appropriate notice if connection succeeds but puppetdb is not available' do it 'returns false and issues an appropriate notice if connection succeeds but puppetdb is not available' do
@ -50,7 +50,7 @@ describe 'Puppet::Util::PuppetdbValidator' do
puppetdb_port = 8081 puppetdb_port = 8081
validator = Puppet::Util::PuppetdbValidator.new(puppetdb_server, puppetdb_port) validator = Puppet::Util::PuppetdbValidator.new(puppetdb_server, puppetdb_port)
Puppet.expects(:notice).with("Unable to connect to puppetdb server (https://#{puppetdb_server}:#{puppetdb_port}): [404] Not found") Puppet.expects(:notice).with("Unable to connect to puppetdb server (https://#{puppetdb_server}:#{puppetdb_port}): [404] Not found")
validator.attempt_connection.should be false expect(validator.attempt_connection).to be false
end end
it 'returns false and issues an appropriate notice if host:port is unreachable or does not exist' do it 'returns false and issues an appropriate notice if host:port is unreachable or does not exist' do
@ -58,7 +58,7 @@ describe 'Puppet::Util::PuppetdbValidator' do
puppetdb_port = nil puppetdb_port = nil
validator = Puppet::Util::PuppetdbValidator.new(puppetdb_server, puppetdb_port) validator = Puppet::Util::PuppetdbValidator.new(puppetdb_server, puppetdb_port)
Puppet.expects(:notice).with("Unable to connect to puppetdb server (https://#{puppetdb_server}:#{puppetdb_port}): Unknown host") Puppet.expects(:notice).with("Unable to connect to puppetdb server (https://#{puppetdb_server}:#{puppetdb_port}): Unknown host")
validator.attempt_connection.should be false expect(validator.attempt_connection).to be false
end end
end end