Skip to content

Commit

Permalink
Fix broken mongoid/tasks/database_rake_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyshields committed Aug 27, 2023
1 parent 1efecc9 commit bc6ec89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/mongoid/tasks/encryption.rake
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ namespace :db do
options[:key_alt_name] = v
end
end
# rubocop:disable Lint/EmptyBlock
parser.parse!(parser.order!(ARGV) {})
# rubocop:enable Lint/EmptyBlock
parser.parse!(parser.order!(ARGV) {}) # rubocop:disable Lint/EmptyBlock

result = Mongoid::Tasks::Encryption.create_data_key(
client_name: options[:client_name],
kms_provider_name: options[:kms_provider_name],
Expand Down
6 changes: 5 additions & 1 deletion spec/mongoid/tasks/database_rake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@

let(:config) do
{
default: {
default: { hosts: SpecConfig.instance.addresses, database: database_id },
encrypted: {
hosts: SpecConfig.instance.addresses,
database: database_id,
options: {
Expand All @@ -355,6 +356,9 @@
.to receive(:create_data_key)
.with('local', {})
.and_call_original

# OptionParser incorrectly handles RSpec's options such as --pattern
allow_any_instance_of(OptionParser).to receive(:order!).and_return({})
end

it "creates the key" do
Expand Down

0 comments on commit bc6ec89

Please sign in to comment.