Sha256: f204aab7e5e47f51bdd38e1e8d10b51b514684aa5e6ab4d12270bcd02faba54b
Contents?: true
Size: 1.61 KB
Versions: 30
Compression:
Stored size: 1.61 KB
Contents
describe 'Gratan::Client#apply' do context 'when load group file' do subject { client } it do dsl = <<-RUBY user 'scott', 'localhost', identified: 'tiger' do on '*.*' do grant 'SELECT' grant 'INSERT' grant 'UPDATE' grant 'DELETE' end on 'test.*' do grant 'SELECT' grant 'INSERT' grant 'UPDATE' grant 'DELETE' end end RUBY tempfile(dsl) do |f| apply(subject) { <<-RUBY require 'time' require '#{f.path}' RUBY } end expect(show_grants).to match_array [ "GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO 'scott'@'localhost' IDENTIFIED BY PASSWORD '*F2F68D0BB27A773C1D944270E5FAFED515A3FA40'", "GRANT SELECT, INSERT, UPDATE, DELETE ON `test`.* TO 'scott'@'localhost'", ] end end context 'when load group file (.rb)' do subject { client } it do dsl = <<-RUBY user 'scott', 'localhost', identified: 'tiger' do on '*.*' do grant 'SELECT' grant 'INSERT' grant 'UPDATE' grant 'DELETE' end on 'test.*' do grant 'SELECT' grant 'INSERT' grant 'UPDATE' grant 'DELETE' end end RUBY tempfile(dsl, ext: '.rb') do |f| apply(subject) { <<-RUBY require 'time' require '#{f.path.sub(/\.rb\z/, '')}' RUBY } end expect(show_grants).to match_array [ "GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO 'scott'@'localhost' IDENTIFIED BY PASSWORD '*F2F68D0BB27A773C1D944270E5FAFED515A3FA40'", "GRANT SELECT, INSERT, UPDATE, DELETE ON `test`.* TO 'scott'@'localhost'", ] end end end
Version data entries
30 entries across 30 versions & 1 rubygems