Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
35eb3fa2
Commit
35eb3fa2
authored
Mar 09, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract idempotent constant into a `let`
So we can use a shorter name within specs.
parent
d4699d09
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
spec/support/shared_examples/workers/idempotency_shared_examples.rb
...rt/shared_examples/workers/idempotency_shared_examples.rb
+2
-0
spec/workers/expire_job_cache_worker_spec.rb
spec/workers/expire_job_cache_worker_spec.rb
+2
-2
No files found.
spec/support/shared_examples/workers/idempotency_shared_examples.rb
View file @
35eb3fa2
...
...
@@ -16,6 +16,8 @@
# end
#
RSpec
.
shared_examples
'an idempotent worker'
do
let
(
:worker_exec_times
)
{
IdempotentWorkerHelper
::
WORKER_EXEC_TIMES
}
# Avoid stubbing calls for a more accurate run.
subject
do
defined?
(
job_args
)
?
perform_multiple
(
job_args
)
:
perform_multiple
...
...
spec/workers/expire_job_cache_worker_spec.rb
View file @
35eb3fa2
...
...
@@ -21,12 +21,12 @@ describe ExpireJobCacheWorker do
allow
(
Gitlab
::
EtagCaching
::
Store
).
to
receive
(
:new
)
{
spy_store
}
expect
(
spy_store
).
to
receive
(
:touch
)
.
exactly
(
IdempotentWorkerHelper
::
WORKER_EXEC_TIMES
).
times
.
exactly
(
worker_exec_times
).
times
.
with
(
pipeline_path
)
.
and_call_original
expect
(
spy_store
).
to
receive
(
:touch
)
.
exactly
(
IdempotentWorkerHelper
::
WORKER_EXEC_TIMES
).
times
.
exactly
(
worker_exec_times
).
times
.
with
(
job_path
)
.
and_call_original
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment