Sha256: c53beff48e7264a7d57dc5c96a8198cd0e07b8b3093d0b3c2c6cd0abc2dbfa70
Contents?: true
Size: 1.49 KB
Versions: 21
Compression:
Stored size: 1.49 KB
Contents
describe 'Gratan::Client#apply' do context 'when create user with target' do subject { client(target_user: /scott/) } it do apply(subject) { <<-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 user 'bob', '%', required: 'SSL' do on '*.*' do grant 'ALL PRIVILEGES' end on 'test.*' do grant 'SELECT' end end RUBY } 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 create user with target (no change)' do subject { client(target_user: /mary/) } 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 user 'bob', '%', required: 'SSL' do on '*.*' do grant 'ALL PRIVILEGES' end on 'test.*' do grant 'SELECT' end end RUBY result = apply(subject) { dsl } expect(result).to be_falsey expect(show_grants).to match_array [] end end end
Version data entries
21 entries across 21 versions & 1 rubygems