File tree 1 file changed +8
-18
lines changed
1 file changed +8
-18
lines changed Original file line number Diff line number Diff line change 80
80
}
81
81
82
82
before do
83
- @count = 0
84
- allow ( fetcher ) . to receive ( :poll ) {
85
- @count += 1
86
- if @count == 1
87
- [ :batches , old_fetched_batches ]
88
- else
89
- [ :batches , fetched_batches ]
90
- end
91
- }
83
+ allow ( fetcher ) . to receive ( :poll ) . and_return (
84
+ [ :batches , old_fetched_batches ] , # first call
85
+ [ :batches , fetched_batches ] # any time after the first call
86
+ )
92
87
end
93
88
end
94
89
121
116
}
122
117
123
118
before do
124
- @count = 0
125
- allow ( fetcher ) . to receive ( :poll ) {
126
- @count += 1
127
- if @count == 1
128
- [ :batches , fetched_batches ]
129
- else
130
- [ :batches , batches_after_partition_reassignment ]
131
- end
132
- }
119
+ allow ( fetcher ) . to receive ( :poll ) . and_return (
120
+ [ :batches , fetched_batches ] , # first call
121
+ [ :batches , batches_after_partition_reassignment ] # any time after the first call
122
+ )
133
123
end
134
124
end
135
125
You can’t perform that action at this time.
0 commit comments