Skip to content

Commit

Permalink
[spec] test blacklist example
Browse files Browse the repository at this point in the history
  • Loading branch information
mikz committed May 5, 2017
1 parent f4f9fd1 commit 4250bc2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions spec/examples/custom-module/blacklist_spec.lua
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)

0 comments on commit 4250bc2

Please sign in to comment.