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