Skip to content

Commit 1e922af

Browse files
author
Johan De Wit
committed
[Acceptance] fix some tests due to changed output mongosh commands
1 parent 8a4f99d commit 1e922af

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

spec/acceptance/server_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class { 'mongodb::server':
150150

151151
describe command("mongosh admin --quiet --eval \"load('/root/.mongoshrc.js');EJSON.stringify(db.getUser('admin')['customData'])\"") do
152152
its(:exit_status) { is_expected.to eq 0 }
153-
its(:stdout) { is_expected.to match "{ \"createdBy\" : \"Puppet Mongodb_user['User admin on db admin']\" }\n" }
153+
its(:stdout) { is_expected.to match "{\"createdBy\":\"Puppet Mongodb_user['User admin on db admin']\"}\n" }
154154
end
155155

156156
describe command('mongod --version') do

spec/acceptance/user_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class { 'mongodb::server': }
2222

2323
it 'creates the user' do
2424
shell("mongosh testdb --quiet --eval 'db.auth(\"testuser\",\"passw0rd\")'") do |r|
25-
expect(r.stdout.chomp).to eq('1')
25+
expect(r.stdout.chomp).to eq('{ ok: 1 }')
2626
end
2727
end
2828

@@ -68,7 +68,7 @@ class { 'mongodb::server': port => 27018 }
6868

6969
it 'creates the user' do
7070
shell("mongosh testdb --quiet --port 27018 --eval 'db.auth(\"testuser\",\"passw0rd\")'") do |r|
71-
expect(r.stdout.chomp).to eq('1')
71+
expect(r.stdout.chomp).to eq('{ ok: 1 }')
7272
end
7373
end
7474
end
@@ -93,7 +93,7 @@ class { 'mongodb::server': }
9393

9494
it 'creates the user' do
9595
shell("mongosh testdb --quiet --eval 'db.auth(\"testuser\",\"passw0rd\")'") do |r|
96-
expect(r.stdout.chomp).to eq('1')
96+
expect(r.stdout.chomp).to eq('{ ok: 1 }')
9797
end
9898
end
9999
end
@@ -126,7 +126,7 @@ class { 'mongodb::server': }
126126

127127
it 'allows the testuser' do
128128
shell("mongosh testdb --quiet --eval 'db.auth(\"testuser\",\"passw0rd\")'") do |r|
129-
expect(r.stdout.chomp).to eq('1')
129+
expect(r.stdout.chomp).to eq('{ ok: 1 }')
130130
end
131131
end
132132

@@ -138,7 +138,7 @@ class { 'mongodb::server': }
138138

139139
it 'allows the second user to connect to its default database' do
140140
shell("mongosh testdb2 --quiet --eval 'db.auth(\"testuser2\",\"passw0rd\")'") do |r|
141-
expect(r.stdout.chomp).to eq('1')
141+
expect(r.stdout.chomp).to eq('{ ok: 1 }')
142142
end
143143
end
144144

0 commit comments

Comments
 (0)