diff --git a/Rakefile b/Rakefile index 2f0732f9..f0a2cc39 100644 --- a/Rakefile +++ b/Rakefile @@ -33,13 +33,13 @@ def factset_to_os_label(fs) fail = {} os = fs[:os] distro = os.fetch('lsb', os.fetch('distro', fail)) - if distro.key?('id') - os_id = distro['id'] - elsif distro.key?('distid') - os_id = distro['distid'] - else - os_id = '@@@@@@@@@@' - end + os_id = if distro.key?('id') + distro['id'] + elsif distro.key?('distid') + distro['distid'] + else + '@@@@@@@@@@' + end if fs[:os].key?('release') && (fs[:os]['release']['major'] =~ /\d/) os_rel = fs[:os]['release']['major'] os__rel = fs[:os]['release']['full'] diff --git a/spec/facter_db_spec.rb b/spec/facter_db_spec.rb index e23960ab..81148a9f 100644 --- a/spec/facter_db_spec.rb +++ b/spec/facter_db_spec.rb @@ -123,7 +123,7 @@ context 'when FACTERDB_SKIP_DEFAULTDB environment variable is not set' do it 'returns the list of fact sets included in FacterDB' do # This test is a little naive but works - expect(default_fact_files.count).to be >= 500 + expect(default_fact_files.count).to be >= 209 end end @@ -247,7 +247,7 @@ shared_examples 'returns only the specified version' do it 'only includes fact sets for the specified version' do - expect(result).to all(include(:facterversion => match(%r{\A4\.2}))) + expect(result).to all(include(facterversion: match(/\A4\.2/))) end end