Remove 3rd party lua plugin support (#11821)
This commit is contained in:
parent
bfd65d6c59
commit
3bec99ecfc
13 changed files with 2 additions and 258 deletions
|
|
@ -1,23 +0,0 @@
|
|||
describe("plugins", function()
|
||||
describe("#run", function()
|
||||
it("runs the plugins in the given order", function()
|
||||
ngx.get_phase = function() return "rewrite" end
|
||||
local plugins = require("plugins")
|
||||
local called_plugins = {}
|
||||
local plugins_to_mock = {"plugins.pluginfirst.main", "plugins.pluginsecond.main", "plugins.pluginthird.main"}
|
||||
for i=1, 3, 1
|
||||
do
|
||||
package.loaded[plugins_to_mock[i]] = {
|
||||
rewrite = function()
|
||||
called_plugins[#called_plugins + 1] = plugins_to_mock[i]
|
||||
end
|
||||
}
|
||||
end
|
||||
assert.has_no.errors(function()
|
||||
plugins.init({"pluginfirst", "pluginsecond", "pluginthird"})
|
||||
end)
|
||||
assert.has_no.errors(plugins.run)
|
||||
assert.are.same(plugins_to_mock, called_plugins)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue