Skip to content

Commit

Permalink
SIRE-9538 fix spec tests // rubocop
Browse files Browse the repository at this point in the history
Reviewed-by: muspelkat, beilers
  • Loading branch information
Henning-B committed Jun 20, 2023
1 parent 9f0f0de commit 9fd6a2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/provider/mongodb_database/mongodb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def self.instances
catch (err) {
rs.slaveOk()
}
'.squeeze(" ")
'.squeeze(' ')
mongo_eval_result = mongo_eval("#{pre_cmd};JSON.stringify(db.getMongo().getDBs())")
dbs = JSON.parse mongo_eval_result

Expand Down
11 changes: 4 additions & 7 deletions spec/acceptance/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
service_name = 'mongod'
package_name = 'mongodb-org-server'
end
major_version=fact('mongodb_version').split('.')[0].to_i
if major_version>=5
mongo_cli=mongosh
major_version = fact('mongodb_version').split('.')[0].to_i
mongo_cli = if major_version >= 5
'mongosh'

Check failure on line 30 in spec/acceptance/server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Layout/IndentationWidth: Use 2 (not -10) spaces for indentation. (https://rubystyle.guide#spaces-indentation)
else

Check failure on line 31 in spec/acceptance/server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Layout/ElseAlignment: Align `else` with `if`.
mongo_cli=mongo
'mongo'
end

Check failure on line 33 in spec/acceptance/server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Layout/EndAlignment: `end` at 33, 2 is not aligned with `if` at 29, 14.


describe 'installation' do
it 'works with no errors' do
pp = <<-EOS
Expand Down Expand Up @@ -150,8 +149,6 @@ class { 'mongodb::client': }
its(:stdout) { is_expected.to match '13' }
end



describe file("/root/.#{mongo_cli}.js") do
it { is_expected.to be_file }
it { is_expected.to be_owned_by 'root' }
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/puppet/provider/mongodb_database/mongodb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
catch (err) {
rs.slaveOk()
}
;JSON.stringify(db.getMongo().getDBs())'.squeeze(" ")
;JSON.stringify(db.getMongo().getDBs())'.squeeze(' ')
allow(provider.class).to receive(:mongo_eval).with(mongodb_eval_command).and_return(raw_dbs)
allow(provider.class).to receive(:db_ismaster).and_return(true)
end
Expand Down

0 comments on commit 9fd6a2e

Please sign in to comment.