php-formula/test/integration/default/controls/package_spec.rb

64 lines
1.2 KiB
Ruby
Raw Normal View History

test: fix rubocop violations Use method: 1. `rubocop -a --safe` 2. `rubocop -A --safe` 3. Use `rubocop:disable` ``` Offenses: test/integration/default/controls/config_spec.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment. control 'Php configuration' do ^ test/integration/default/controls/config_spec.rb:4:3: C: Metrics/AbcSize: Assignment Branch Condition size for test_debian is too high. [<0, 26, 0> 26/17] (http://c2.com/cgi/wiki?AbcMetric, https://en.wikipedia.org/wiki/ABC_Software_Metric) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/config_spec.rb:4:3: C: Metrics/MethodLength: Method has too many lines. [14/10] (https://rubystyle.guide#short-methods) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/config_spec.rb:24:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_redhat ... ^^^^^^^^^^^^^^^ test/integration/default/controls/config_spec.rb:27:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_suse ... ^^^^^^^^^^^^^ test/integration/default/controls/package_spec.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment. control 'Php package' do ^ test/integration/default/controls/package_spec.rb:4:3: C: Metrics/AbcSize: Assignment Branch Condition size for test_debian is too high. [<1, 26, 1> 26.04/17] (http://c2.com/cgi/wiki?AbcMetric, https://en.wikipedia.org/wiki/ABC_Software_Metric) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/package_spec.rb:4:3: C: Metrics/MethodLength: Method has too many lines. [20/10] (https://rubystyle.guide#short-methods) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/package_spec.rb:21:1: C: Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. (https://rubystyle.guide#empty-lines-around-bodies) test/integration/default/controls/service_spec.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment. control 'Php service' do ^ test/integration/default/controls/service_spec.rb:16:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_redhat ... ^^^^^^^^^^^^^^^ test/integration/default/controls/service_spec.rb:19:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_suse ... ^^^^^^^^^^^^^ 7 files inspected, 12 offenses detected, 8 offenses auto-correctable ```
2020-12-22 15:42:11 +01:00
# frozen_string_literal: true
control 'Php package' do
title 'should be installed'
test: fix rubocop violations Use method: 1. `rubocop -a --safe` 2. `rubocop -A --safe` 3. Use `rubocop:disable` ``` Offenses: test/integration/default/controls/config_spec.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment. control 'Php configuration' do ^ test/integration/default/controls/config_spec.rb:4:3: C: Metrics/AbcSize: Assignment Branch Condition size for test_debian is too high. [<0, 26, 0> 26/17] (http://c2.com/cgi/wiki?AbcMetric, https://en.wikipedia.org/wiki/ABC_Software_Metric) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/config_spec.rb:4:3: C: Metrics/MethodLength: Method has too many lines. [14/10] (https://rubystyle.guide#short-methods) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/config_spec.rb:24:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_redhat ... ^^^^^^^^^^^^^^^ test/integration/default/controls/config_spec.rb:27:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_suse ... ^^^^^^^^^^^^^ test/integration/default/controls/package_spec.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment. control 'Php package' do ^ test/integration/default/controls/package_spec.rb:4:3: C: Metrics/AbcSize: Assignment Branch Condition size for test_debian is too high. [<1, 26, 1> 26.04/17] (http://c2.com/cgi/wiki?AbcMetric, https://en.wikipedia.org/wiki/ABC_Software_Metric) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/package_spec.rb:4:3: C: Metrics/MethodLength: Method has too many lines. [20/10] (https://rubystyle.guide#short-methods) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/package_spec.rb:21:1: C: Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. (https://rubystyle.guide#empty-lines-around-bodies) test/integration/default/controls/service_spec.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment. control 'Php service' do ^ test/integration/default/controls/service_spec.rb:16:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_redhat ... ^^^^^^^^^^^^^^^ test/integration/default/controls/service_spec.rb:19:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_suse ... ^^^^^^^^^^^^^ 7 files inspected, 12 offenses detected, 8 offenses auto-correctable ```
2020-12-22 15:42:11 +01:00
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
def test_debian
describe package('php-imagick') do
it { should be_installed }
end
2019-09-04 22:46:11 +02:00
describe package('php-xdebug') do
it { should be_installed }
end
%w[
bz2 cli curl fpm gd imap intl mbstring
mysql readline redis xml zip
].each do |pkg|
describe package("php5.6-#{pkg}") do
it { should be_installed }
end
describe package("php7.3-#{pkg}") do
it { should be_installed }
end
end
end
test: fix rubocop violations Use method: 1. `rubocop -a --safe` 2. `rubocop -A --safe` 3. Use `rubocop:disable` ``` Offenses: test/integration/default/controls/config_spec.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment. control 'Php configuration' do ^ test/integration/default/controls/config_spec.rb:4:3: C: Metrics/AbcSize: Assignment Branch Condition size for test_debian is too high. [<0, 26, 0> 26/17] (http://c2.com/cgi/wiki?AbcMetric, https://en.wikipedia.org/wiki/ABC_Software_Metric) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/config_spec.rb:4:3: C: Metrics/MethodLength: Method has too many lines. [14/10] (https://rubystyle.guide#short-methods) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/config_spec.rb:24:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_redhat ... ^^^^^^^^^^^^^^^ test/integration/default/controls/config_spec.rb:27:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_suse ... ^^^^^^^^^^^^^ test/integration/default/controls/package_spec.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment. control 'Php package' do ^ test/integration/default/controls/package_spec.rb:4:3: C: Metrics/AbcSize: Assignment Branch Condition size for test_debian is too high. [<1, 26, 1> 26.04/17] (http://c2.com/cgi/wiki?AbcMetric, https://en.wikipedia.org/wiki/ABC_Software_Metric) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/package_spec.rb:4:3: C: Metrics/MethodLength: Method has too many lines. [20/10] (https://rubystyle.guide#short-methods) def test_debian ... ^^^^^^^^^^^^^^^ test/integration/default/controls/package_spec.rb:21:1: C: Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. (https://rubystyle.guide#empty-lines-around-bodies) test/integration/default/controls/service_spec.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment. control 'Php service' do ^ test/integration/default/controls/service_spec.rb:16:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_redhat ... ^^^^^^^^^^^^^^^ test/integration/default/controls/service_spec.rb:19:3: C: Style/EmptyMethod: Put empty method definitions on a single line. (https://rubystyle.guide#no-single-line-methods) def test_suse ... ^^^^^^^^^^^^^ 7 files inspected, 12 offenses detected, 8 offenses auto-correctable ```
2020-12-22 15:42:11 +01:00
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
def test_redhat
describe package('php') do
it { should be_installed }
end
end
def test_suse
describe package('php8') do
it { should be_installed }
end
end
def test_bsd
%w[
php74 php74-filter php74-json php74-mbstring php74-openssl php74-phar
].each do |pkg|
describe package(pkg) do
it { should be_installed }
end
end
end
case os[:family]
when 'debian'
test_debian
when 'redhat', 'fedora'
test_redhat
when 'suse'
test_suse
when 'bsd'
test_bsd
end
end