From 4f12b0c7f90535def7d72e15aba730d80a01d741 Mon Sep 17 00:00:00 2001 From: Dejan Golja Date: Sun, 12 Jan 2014 10:38:21 +1100 Subject: [PATCH] Add system test to cover procedure creation scenario --- spec/acceptance/types/mysql_grant_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec/acceptance/types/mysql_grant_spec.rb b/spec/acceptance/types/mysql_grant_spec.rb index 422c14c..8392efb 100644 --- a/spec/acceptance/types/mysql_grant_spec.rb +++ b/spec/acceptance/types/mysql_grant_spec.rb @@ -283,4 +283,26 @@ describe 'mysql_grant' do expect(apply_manifest(pp, :catch_failures => true).exit_code).to eq(0) end end + + describe 'adding procedure privileges' do + it 'should work without errors' do + pp = <<-EOS + mysql_grant { 'test2@tester/PROCEDURE test.simpleproc': + ensure => 'present', + table => 'PROCEDURE test.simpleproc', + user => 'test2@tester', + privileges => ['EXECUTE'], + } + EOS + + apply_manifest(pp, :catch_failures => true) + end + + it 'should find the user' do + shell("mysql -NBe \"SHOW GRANTS FOR test2@tester\"") do |r| + expect(r.stdout).to match(/GRANT EXECUTE ON PROCEDURE `test`.`simpleproc` TO 'test2'@'tester'/) + expect(r.stderr).to be_empty + end + end + end end