-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
local _M = require 'examples.custom-module.blacklist' | ||
local apicast = require 'apicast' | ||
|
||
describe('blacklist', function() | ||
it('returns new module instance', function() | ||
local blacklist = _M.new() | ||
|
||
assert.table(blacklist) | ||
assert.equal(_M.balancer, blacklist.balancer) | ||
assert.equal(_M.init, blacklist.init) | ||
end) | ||
|
||
it('has all apicast methods', function() | ||
local blacklist = _M.new() | ||
|
||
assert['function'](blacklist.init) | ||
|
||
for _,fun in ipairs{'init_worker', 'rewrite', 'post_action', 'access', 'log'} do | ||
assert.equal(apicast[fun], blacklist[fun], fun .. " is not inherited from apicast") | ||
end | ||
|
||
assert['function'](blacklist.balancer) | ||
end) | ||
end) |