Sha256: 3744b3d4c28b259f10ef8a0c36a802a74293939d07366c55962b2b88a97eaea4
Contents?: true
Size: 1.88 KB
Versions: 30
Compression:
Stored size: 1.88 KB
Contents
describe 'Gratan::Client#apply' do context 'when create user' do subject { client(dry_run: true) } it do result = 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 RUBY } expect(result).to be_falsey expect(show_grants).to match_array [] end end context 'when add user' do before do apply { <<-RUBY user 'bob', '%', required: 'SSL' do on '*.*' do grant 'ALL PRIVILEGES' end on 'test.*' do grant 'SELECT' end end RUBY } end subject { client(dry_run: true) } it do apply(subject) { <<-RUBY user 'bob', '%', required: 'SSL' do on '*.*' do grant 'ALL PRIVILEGES' end on 'test.*' do grant 'SELECT' end end 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 } expect(show_grants).to match_array [ "GRANT ALL PRIVILEGES ON *.* TO 'bob'@'%' REQUIRE SSL", "GRANT SELECT ON `test`.* TO 'bob'@'%'", ] end end context 'when create user with grant option' do subject { client(dry_run: true) } it do apply(subject) { <<-RUBY user 'scott', 'localhost', identified: 'tiger' do on '*.*', with: 'grant option' do grant 'SELECT' grant 'INSERT' grant 'UPDATE' grant 'DELETE' end on 'test.*' do grant 'SELECT' grant 'INSERT' grant 'UPDATE' grant 'DELETE' end end RUBY } expect(show_grants).to match_array [] end end end
Version data entries
30 entries across 30 versions & 1 rubygems