spec/runners/crud.rb in mongo-2.15.0.alpha vs spec/runners/crud.rb in mongo-2.15.0
- old
+ new
@@ -1,5 +1,8 @@
+# frozen_string_literal: true
+# encoding: utf-8
+
# Copyright (C) 2014-2020 MongoDB Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -120,10 +123,19 @@
end
if operation.outcome.error?
it 'raises an error' do
expect(result).to be_a(Mongo::Error)
+ if operation.outcome.result
+ verifier.verify_operation_result(
+ operation.outcome.result,
+ {
+ 'errorContains' => result.message,
+ 'errorLabels' => result.labels,
+ }
+ )
+ end
end
else
tested = false
if operation.outcome.result
@@ -209,9 +221,19 @@
if req.max_server_version
max_server_version req.short_max_server_version
end
if req.topologies
require_topology *req.topologies
+ end
+ if SpecConfig.instance.serverless? && req.serverless == :forbid
+ before(:all) do
+ skip "Serverless forbidden"
+ end
+ end
+ if !SpecConfig.instance.serverless? && req.serverless == :require
+ before(:all) do
+ skip "Serverless required"
+ end
end
instance_exec(req, &block)
end
end