Sha256: b42e051270a2ab4c89d9830c6c3c914d3d32cd2b053af8d3e31abf43f37f385f
Contents?: true
Size: 1.64 KB
Versions: 34
Compression:
Stored size: 1.64 KB
Contents
describe 'Gratan::Client#export' do context 'when user does not exist' do subject { client } it do expect(subject.export.strip).to eq '' end end context 'when user exists' do let(:grantfile) { <<-RUBY user "scott", "%" do on "*.*" do grant "USAGE" end on "test.*" do grant "SELECT" end end user "scott", "localhost" do on "*.*" do grant "USAGE" end on "test.*" do grant "SELECT" end end RUBY } subject { client } before do apply(subject) do grantfile end end it do expect(subject.export.strip).to eq grantfile.strip end end context 'when ignore user exists' do let(:grantfile) { <<-RUBY user "scott", "%" do on "*.*" do grant "USAGE" end on "test.*" do grant "SELECT" end end user "bob", "localhost" do on "*.*" do grant "USAGE" end on "test.*" do grant "SELECT" end end RUBY } subject { client(ignore_user: /\Abob\z/) } before do apply(subject) do grantfile end end it do expect(subject.export.strip).to eq <<-RUBY.strip user "scott", "%" do on "*.*" do grant "USAGE" end on "test.*" do grant "SELECT" end end RUBY end end context 'when with option exists' do let(:grantfile) { <<-RUBY user "scott", "%" do on "*.*", :with=>"GRANT OPTION" do grant "USAGE" end end RUBY } subject { client(ignore_user: /\Abob\z/) } before do apply(subject) do grantfile end end it do expect(subject.export.strip).to eq grantfile.strip end end end
Version data entries
34 entries across 34 versions & 1 rubygems