summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/lib/gitlab/memory/watchdog/monitor_result_shared_examples.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/lib/gitlab/memory/watchdog/monitor_result_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/lib/gitlab/memory/watchdog/monitor_result_shared_examples.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/shared_examples/lib/gitlab/memory/watchdog/monitor_result_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/memory/watchdog/monitor_result_shared_examples.rb
new file mode 100644
index 00000000000..98c0e7d506b
--- /dev/null
+++ b/spec/support/shared_examples/lib/gitlab/memory/watchdog/monitor_result_shared_examples.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+RSpec.shared_examples 'returns Watchdog Monitor result' do |threshold_violated:|
+ it 'returns if threshold is violated and payload' do
+ result = monitor.call
+
+ expect(result[:threshold_violated]).to eq(threshold_violated)
+ expect(result[:payload]).to eq(payload)
+ end
+end