Skip to content

Commit f7b93a0

Browse files
author
Daniel Carabas
committed
Update spec_helper_acceptance_local.rb
1 parent d49e874 commit f7b93a0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

spec/spec_helper_acceptance_local.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
# frozen_string_literal: true
22

3+
require 'singleton'
4+
5+
class LitmusHelper
6+
include Singleton
7+
include PuppetLitmus
8+
end
9+
310
def pre_run
4-
apply_manifest("class { 'mysql::server': root_password => 'password' }", catch_failures: true)
11+
LitmusHelper.instance.apply_manifest("class { 'mysql::server': root_password => 'password' }", catch_failures: true)
512
end
613

714
def mysql_version
8-
shell_output = run_shell('mysql --version', expect_failures: true)
15+
shell_output = LitmusHelper.instance.run_shell('mysql --version', expect_failures: true)
916
if shell_output.stdout.match(%r{\d+\.\d+\.\d+}).nil?
1017
pre_run
11-
shell_output = run_shell('mysql --version')
18+
shell_output = LitmusHelper.instance.run_shell('mysql --version')
1219
raise _('unable to get mysql version') if shell_output.stdout.match(%r{\d+\.\d+\.\d+}).nil?
1320
end
1421
mysql_version = shell_output.stdout.match(%r{\d+\.\d+\.\d+})[0]
@@ -19,9 +26,9 @@ def mysql_version
1926
c.before :suite do
2027
if os[:family] == 'debian' || os[:family] == 'ubuntu'
2128
# needed for the puppet fact
22-
apply_manifest("package { 'lsb-release': ensure => installed, }", expect_failures: false)
29+
LitmusHelper.instance.apply_manifest("package { 'lsb-release': ensure => installed, }", expect_failures: false)
2330
end
2431
# needed for the grant tests, not installed on el7 docker images
25-
apply_manifest("package { 'which': ensure => installed, }", expect_failures: false)
32+
LitmusHelper.instance.apply_manifest("package { 'which': ensure => installed, }", expect_failures: false)
2633
end
2734
end

0 commit comments

Comments
 (0)