canvas_sync 0.17.23 → 0.17.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -66,10 +66,10 @@ RSpec.describe CanvasSync::JobBatches::BatchAwareJob do
66
66
  let(:bid) { 'SAMPLEBID' }
67
67
 
68
68
  before do
69
- Thread.current[:batch] = CanvasSync::JobBatches::Batch.new(bid)
70
- Thread.current[:batch].instance_variable_set(:@open, true)
69
+ Thread.current[CanvasSync::JobBatches::CURRENT_BATCH_THREAD_KEY] = CanvasSync::JobBatches::Batch.new(bid)
70
+ Thread.current[CanvasSync::JobBatches::CURRENT_BATCH_THREAD_KEY].instance_variable_set(:@open, true)
71
71
  end
72
- after { Thread.current[:batch] = nil }
72
+ after { Thread.current[CanvasSync::JobBatches::CURRENT_BATCH_THREAD_KEY] = nil }
73
73
 
74
74
  it 'yields' do
75
75
  expect {
@@ -70,7 +70,7 @@ RSpec.describe CanvasSync::JobBatches::Batch do
70
70
  it 'sets Thread.current bid' do
71
71
  batch = CanvasSync::JobBatches::Batch.new
72
72
  batch.jobs do
73
- expect(Thread.current[:batch]).to eq(batch)
73
+ expect(Thread.current[CanvasSync::JobBatches::CURRENT_BATCH_THREAD_KEY]).to eq(batch)
74
74
  end
75
75
  end
76
76
  end
@@ -57,8 +57,8 @@ RSpec.describe CanvasSync::JobBatches::Sidekiq do
57
57
  context 'when in batch' do
58
58
  let(:bid) { 'SAMPLEBID' }
59
59
  let(:jid) { 'SAMPLEJID' }
60
- before { Thread.current[:batch] = CanvasSync::JobBatches::Batch.new(bid) }
61
- after { Thread.current[:batch] = nil }
60
+ before { Thread.current[CanvasSync::JobBatches::CURRENT_BATCH_THREAD_KEY] = CanvasSync::JobBatches::Batch.new(bid) }
61
+ after { Thread.current[CanvasSync::JobBatches::CURRENT_BATCH_THREAD_KEY] = nil }
62
62
 
63
63
  it 'yields' do
64
64
  yielded = false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.23
4
+ version: 0.17.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Collings
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-21 00:00:00.000000000 Z
11
+ date: 2021-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails