Skip to content

Commit

Permalink
CAT-1147 erb to epp conversion linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinesh Gujar authored and Dinesh Gujar committed Aug 2, 2023
1 parent eadd13a commit 763c870
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
1 change: 1 addition & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ RSpec/NamedSubject:
- 'spec/classes/mysql_server_spec.rb'
- 'spec/defines/mysql_db_spec.rb'
- 'spec/functions/mysql_normalise_and_deepmerge_spec.rb'
- 'spec/functions/mysql_innobackupex_args_spec.rb'
- 'spec/functions/mysql_strip_hash_spec.rb'

# Offense count: 45
Expand Down
38 changes: 21 additions & 17 deletions spec/functions/mysql_innobackupex_args_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,41 @@
expect(subject).to run.with_params('', true, '', [], [])
end

it 'returns args with username and password' do
expect(subject).to run.with_params('root', false, '12345', [], []).and_return('--user="root" --password="12345"')
end
context 'should work with username and password' do
it 'returns args with username and password' do
expect(subject).to run.with_params('root', false, '12345', [], []).and_return('--user="root" --password="12345"')
end

it 'returns args with database lists' do
expect(subject).to run.with_params('root', false, '12345', ['db1', 'db2'], []).and_return('--user="root" --password="12345" --databases="db1 db2"')
end

it 'returns args with database lists' do
expect(subject).to run.with_params('root', false, '12345', ['db1', 'db2'], []).and_return('--user="root" --password="12345" --databases="db1 db2"')
it 'returns args with backup compress only' do
expected_results = '--user="root" --password="12345" --compress'
expect(subject).to run.with_params('root', true, '12345', [], []).and_return(expected_results)
end

it 'returns args with backup compress, database list and optional_args' do
expected_results = '--user="root" --password="12345" --compress --databases="db1 db2" tst_arg_1 tst_arg_2'
expect(subject).to run.with_params('root', true, '12345', ['db1', 'db2'], ['tst_arg_1', 'tst_arg_2']).and_return(expected_results)
end
end

it 'returns args without database list' do
expect(subject).to run.with_params('root', false, '12345', [], []).and_return('--user="root" --password="12345"')
context 'should work without database args' do
it 'returns args without database list' do
expect(subject).to run.with_params('root', false, '12345', [], []).and_return('--user="root" --password="12345"')
end
end

it 'returns args without backup compress' do
expect(subject).to run.with_params('root', false, '12345', [], []).and_return('--user="root" --password="12345"')
end

it 'returns args with backup compress only' do
expected_results = '--user="root" --password="12345" --compress'
expect(subject).to run.with_params('root', true, '12345', [], []).and_return(expected_results)
end

it 'returns args with backup compress and database list' do
expected_results = '--user="root" --password="12345" --compress --databases="db1 db2"'
expect(subject).to run.with_params('root', true, '12345', ['db1', 'db2'], []).and_return(expected_results)
end

it 'returns args with backup compress, database list and optional_args' do
expected_results = '--user="root" --password="12345" --compress --databases="db1 db2" tst_arg_1 tst_arg_2'
expect(subject).to run.with_params('root', true, '12345', ['db1', 'db2'], ['tst_arg_1', 'tst_arg_2']).and_return(expected_results)
end

it 'returns args without backup compress database list and optional_args' do
expected_results = '--user="root" --password="12345" --databases="db1 db2" tst_arg_1 tst_arg_2'
expect(subject).to run.with_params('root', false, '12345', ['db1', 'db2'], ['tst_arg_1', 'tst_arg_2']).and_return(expected_results)
Expand Down

0 comments on commit 763c870

Please sign in to comment.