Skip to content

Commit

Permalink
fix busted tests: spec/policy/apicast/apicast_spec.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Nov 2, 2023
1 parent 3244915 commit 385b346
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/policy/apicast/apicast_spec.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
local _M = require 'apicast.policy.apicast'

describe('APIcast policy', function()
local ngx_on_abort_stub

before_each(function()
-- .access calls ngx.on_abort
-- busted tests are called in the context of ngx.timer
-- and that API ngx.on_abort is disabled in that context.
-- this stub is mocking the call
-- to prevent the internal error: API disabled in the context of ngx.timer
ngx_on_abort_stub = stub(ngx, 'on_abort')
end)

it('has a name', function()
assert.truthy(_M._NAME)
Expand Down

0 comments on commit 385b346

Please sign in to comment.