From e06fc02731fc737de3b334f194798ccdf1ea554d Mon Sep 17 00:00:00 2001 From: Bryan Jen Date: Wed, 17 Feb 2016 12:54:02 -0700 Subject: [PATCH] Revert "Add postgresql_version fact" --- lib/facter/postgresql_version.rb | 8 -------- spec/unit/postgresql_version_spec.rb | 19 ------------------- 2 files changed, 27 deletions(-) delete mode 100644 lib/facter/postgresql_version.rb delete mode 100644 spec/unit/postgresql_version_spec.rb diff --git a/lib/facter/postgresql_version.rb b/lib/facter/postgresql_version.rb deleted file mode 100644 index 605479e..0000000 --- a/lib/facter/postgresql_version.rb +++ /dev/null @@ -1,8 +0,0 @@ -Facter.add(:postgresql_version) do - setcode do - if Facter::Util::Resolution.which('psql') - postgresql_version = Facter::Util::Resolution.exec('psql -V 2>&1') - %r{^psql \(PostgreSQL\) ([\w\.]+)}.match(postgresql_version)[1] - end - end -end diff --git a/spec/unit/postgresql_version_spec.rb b/spec/unit/postgresql_version_spec.rb deleted file mode 100644 index efe4509..0000000 --- a/spec/unit/postgresql_version_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe Facter::Util::Fact do - before do - Facter.clear - end - - describe 'postgresql_version' do - context 'with value' do - before :each do - allow(Facter::Util::Resolution).to receive(:which).with('psql').and_return(true) - allow(Facter::Util::Resolution).to receive(:exec).with('psql -V 2>&1').and_return('psql (PostgreSQL) 9.4.5') - end - it do - expect(Facter.fact(:postgresql_version).value).to eq('9.4.5') - end - end - end -end