diff --git a/spec/mongoid/tasks/database_rake_spec.rb b/spec/mongoid/tasks/database_rake_spec.rb index c61adba2c5..e397663ea5 100644 --- a/spec/mongoid/tasks/database_rake_spec.rb +++ b/spec/mongoid/tasks/database_rake_spec.rb @@ -402,7 +402,8 @@ let(:config) do { - default: { + default: { hosts: SpecConfig.instance.addresses, database: database_id }, + encrypted: { hosts: SpecConfig.instance.addresses, database: database_id, options: { @@ -423,6 +424,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