diff options
author | Rémy Coutable <remy@rymai.me> | 2018-03-29 12:47:54 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-04-23 13:20:30 +0300 |
commit | 023d4f6f2f3d88d0966fe01e6ef921fd03a309fe (patch) | |
tree | 6aabb650fe2ba200222c57f1a4ac66ff0a9143e8 /spec/support/shared_examples/gitlab_verify.rb | |
parent | eb1cb7bed6951bdda54abd55e86fd793e6954a56 (diff) |
Move spec helpers/matchers/shared examples/contexts to their relevant folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/support/shared_examples/gitlab_verify.rb')
-rw-r--r-- | spec/support/shared_examples/gitlab_verify.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/support/shared_examples/gitlab_verify.rb b/spec/support/shared_examples/gitlab_verify.rb new file mode 100644 index 00000000000..560913ca92f --- /dev/null +++ b/spec/support/shared_examples/gitlab_verify.rb @@ -0,0 +1,19 @@ +RSpec.shared_examples 'Gitlab::Verify::BatchVerifier subclass' do + describe 'batching' do + let(:first_batch) { objects[0].id..objects[0].id } + let(:second_batch) { objects[1].id..objects[1].id } + let(:third_batch) { objects[2].id..objects[2].id } + + it 'iterates through objects in batches' do + expect(collect_ranges).to eq([first_batch, second_batch, third_batch]) + end + + it 'allows the starting ID to be specified' do + expect(collect_ranges(start: second_batch.first)).to eq([second_batch, third_batch]) + end + + it 'allows the finishing ID to be specified' do + expect(collect_ranges(finish: second_batch.last)).to eq([first_batch, second_batch]) + end + end +end |