mirror of
https://github.com/saltstack-formulas/packages-formula.git
synced 2025-04-17 10:10:27 +00:00
fix(rubocop): add fixes using rubocop -a --safe
This commit is contained in:
parent
08340c857a
commit
1f72c405de
4 changed files with 28 additions and 20 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
### ARCHIVE PKGS
|
### ARCHIVE PKGS
|
||||||
control 'Archive packages' do
|
control 'Archive packages' do
|
||||||
title 'should be downloaded and installed'
|
title 'should be downloaded and installed'
|
||||||
|
@ -7,10 +9,10 @@ control 'Archive packages' do
|
||||||
os.debian?
|
os.debian?
|
||||||
end
|
end
|
||||||
|
|
||||||
%w(
|
%w[
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
phantomjs-2.1.1-linux-x86_64/bin
|
phantomjs-2.1.1-linux-x86_64/bin
|
||||||
).each do |f|
|
].each do |f|
|
||||||
describe file("/usr/local/src/#{f}") do
|
describe file("/usr/local/src/#{f}") do
|
||||||
it { should exist }
|
it { should exist }
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
### WANTED/REQUIRED
|
### WANTED/REQUIRED
|
||||||
control 'Wanted/Required gems' do
|
control 'Wanted/Required gems' do
|
||||||
title 'should be installed'
|
title 'should be installed'
|
||||||
|
|
||||||
%w{
|
%w[
|
||||||
progressbar
|
progressbar
|
||||||
minitest
|
minitest
|
||||||
}.each do |p|
|
].each do |p|
|
||||||
describe gem(p) do
|
describe gem(p) do
|
||||||
it { should be_installed }
|
it { should be_installed }
|
||||||
end
|
end
|
||||||
|
@ -15,11 +17,11 @@ end
|
||||||
### UNWANTED
|
### UNWANTED
|
||||||
control 'Unwanted gems' do
|
control 'Unwanted gems' do
|
||||||
title 'should be uninstalled'
|
title 'should be uninstalled'
|
||||||
%w{
|
%w[
|
||||||
diff-lcs
|
diff-lcs
|
||||||
kwalify
|
kwalify
|
||||||
kitchen-vagrant
|
kitchen-vagrant
|
||||||
}.each do |p|
|
].each do |p|
|
||||||
describe gem(p) do
|
describe gem(p) do
|
||||||
it { should_not be_installed }
|
it { should_not be_installed }
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
## Some vars
|
## Some vars
|
||||||
common_packages = %w(
|
common_packages = %w[
|
||||||
git
|
git
|
||||||
less
|
less
|
||||||
bc
|
bc
|
||||||
curl
|
curl
|
||||||
fail2ban
|
fail2ban
|
||||||
)
|
]
|
||||||
|
|
||||||
case platform[:family]
|
case platform[:family]
|
||||||
when 'redhat'
|
when 'redhat'
|
||||||
platform_packages = %w(yum-plugin-versionlock)
|
platform_packages = %w[yum-plugin-versionlock]
|
||||||
held_packages = {
|
held_packages = {
|
||||||
# We use this test for held packages in a list,
|
# We use this test for held packages in a list,
|
||||||
# with no version (current version).
|
# with no version (current version).
|
||||||
|
@ -32,16 +34,16 @@ when 'fedora'
|
||||||
# Adding empty Suse entries, to get tests passing
|
# Adding empty Suse entries, to get tests passing
|
||||||
# Don't know the correct values to add here.
|
# Don't know the correct values to add here.
|
||||||
when 'suse'
|
when 'suse'
|
||||||
platform_packages = %w()
|
platform_packages = %w[]
|
||||||
held_packages = {}
|
held_packages = {}
|
||||||
lock_file = ''
|
lock_file = ''
|
||||||
# Adding empty Arch entries, to get tests passing
|
# Adding empty Arch entries, to get tests passing
|
||||||
when 'arch'
|
when 'arch'
|
||||||
platform_packages = %w()
|
platform_packages = %w[]
|
||||||
held_packages = {}
|
held_packages = {}
|
||||||
lock_file = ''
|
lock_file = ''
|
||||||
when 'debian'
|
when 'debian'
|
||||||
platform_packages = %w()
|
platform_packages = %w[]
|
||||||
held_packages = {
|
held_packages = {
|
||||||
'alien': '8.95',
|
'alien': '8.95',
|
||||||
# To match also ubuntu16's
|
# To match also ubuntu16's
|
||||||
|
@ -54,11 +56,11 @@ when 'amazon'
|
||||||
held_packages = []
|
held_packages = []
|
||||||
end
|
end
|
||||||
|
|
||||||
## FIXME - not testing Held packages
|
# # FIXME - not testing Held packages
|
||||||
held_packages = {}
|
held_packages = {}
|
||||||
|
|
||||||
unheld_packages = (common_packages + platform_packages).flatten.uniq
|
unheld_packages = (common_packages + platform_packages).flatten.uniq
|
||||||
all_packages = (unheld_packages + held_packages.keys.map { |k| k.to_s }).flatten.uniq
|
all_packages = (unheld_packages + held_packages.keys.map(&:to_s)).flatten.uniq
|
||||||
|
|
||||||
### WANTED/REQUIRED/HELD
|
### WANTED/REQUIRED/HELD
|
||||||
control 'Wanted/Required/Held packages' do
|
control 'Wanted/Required/Held packages' do
|
||||||
|
@ -75,7 +77,7 @@ end
|
||||||
control 'Wanted packages' do
|
control 'Wanted packages' do
|
||||||
title 'should NOT be marked as hold'
|
title 'should NOT be marked as hold'
|
||||||
|
|
||||||
unheld_packages.each do |p,v|
|
unheld_packages.each do |p, v|
|
||||||
case platform[:family]
|
case platform[:family]
|
||||||
when 'redhat', 'fedora'
|
when 'redhat', 'fedora'
|
||||||
match_string = "#{p}-.*#{v}"
|
match_string = "#{p}-.*#{v}"
|
||||||
|
@ -95,26 +97,26 @@ end
|
||||||
control 'Held packages' do
|
control 'Held packages' do
|
||||||
title 'should be marked as hold'
|
title 'should be marked as hold'
|
||||||
|
|
||||||
held_packages.each do |p,v|
|
held_packages.each do |p, v|
|
||||||
case platform[:family]
|
case platform[:family]
|
||||||
when 'redhat', 'fedora'
|
when 'redhat', 'fedora'
|
||||||
match_string = "#{p}-.*#{v}"
|
match_string = "#{p}-.*#{v}"
|
||||||
when 'debian'
|
when 'debian'
|
||||||
match_string = "^Package: #{p}\nStatus: hold ok installed\nP.*\nS.*\nI.*\nM.*\nA.*\nVersion: #{v}"
|
match_string = "^Package: #{p}\nStatus: hold ok installed\nP.*\nS.*\nI.*\nM.*\nA.*\nVersion: #{v}"
|
||||||
end
|
end
|
||||||
|
|
||||||
describe file(lock_file) do
|
describe file(lock_file) do
|
||||||
its('content') { should match(match_string) }
|
its('content') { should match(match_string) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
### UNWANTED
|
### UNWANTED
|
||||||
control 'Unwanted packages' do
|
control 'Unwanted packages' do
|
||||||
title 'should be uninstalled'
|
title 'should be uninstalled'
|
||||||
%w{
|
%w[
|
||||||
avahi-daemon
|
avahi-daemon
|
||||||
}.each do |p|
|
].each do |p|
|
||||||
describe package(p) do
|
describe package(p) do
|
||||||
it { should_not be_installed }
|
it { should_not be_installed }
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
### REMOTE PKGS
|
### REMOTE PKGS
|
||||||
remote_pkgs = ['zoom']
|
remote_pkgs = ['zoom']
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue