From ad5381d67a9b67d56fff1c1021e14a02ba4f28d8 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Fri, 9 May 2014 15:11:57 -0400 Subject: [PATCH] Fix to install ruby-mysql from gem. --- spec/acceptance/mysql_bindings_spec.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/spec/acceptance/mysql_bindings_spec.rb b/spec/acceptance/mysql_bindings_spec.rb index b7e25d6..ac0a15a 100644 --- a/spec/acceptance/mysql_bindings_spec.rb +++ b/spec/acceptance/mysql_bindings_spec.rb @@ -2,6 +2,7 @@ require 'spec_helper_acceptance' osfamily = fact('osfamily') operatingsystem = fact('operatingsystem') +ruby_package_provider = 'undef' case osfamily when 'RedHat' @@ -10,6 +11,9 @@ when 'RedHat' php_package = 'php-mysql' python_package = 'MySQL-python' ruby_package = 'ruby-mysql' + if fact('operatingsystemmajrelease') == '7' + ruby_package_provider = 'gem' + end when 'Suse' java_package = 'mysql-connector-java' perl_package = 'perl-DBD-mysql' @@ -81,7 +85,7 @@ describe 'mysql::bindings class', :unless => UNSUPPORTED_PLATFORMS.include?(fact perl_package_provider => undef, php_package_provider => undef, python_package_provider => undef, - ruby_package_provider => undef, + ruby_package_provider => #{ruby_package_provider}, } EOS @@ -110,8 +114,15 @@ describe 'mysql::bindings class', :unless => UNSUPPORTED_PLATFORMS.include?(fact it { should be_installed } end - describe package(ruby_package) do - it { should be_installed } + # ruby-mysql is installed via gem on RHEL7, be_installed doesn't know how to check that + if fact('osfamily') == 'RedHat' && fact('operatingsystemmajrelease') == '7' + describe package(ruby_package) do + it { should_not be_installed } + end + else + describe package(ruby_package) do + it { should be_installed } + end end end end