Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Commit 9b4160f

Browse files
committed
Add match to busted env and exported functions
This adds the `match` function from `luassert` to the busted test environment and exports it as part of the busted public API.
1 parent 159c519 commit 9b4160f

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

busted/init.lua

+2
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ local function init(busted)
8989
local spy = require 'luassert.spy'
9090
local mock = require 'luassert.mock'
9191
local stub = require 'luassert.stub'
92+
local match = require 'luassert.match'
9293

9394
busted.export('assert', assert)
9495
busted.export('spy', spy)
9596
busted.export('mock', mock)
9697
busted.export('stub', stub)
98+
busted.export('match', match)
9799

98100
busted.exportApi('publish', busted.publish)
99101
busted.exportApi('subscribe', busted.subscribe)

spec/core_spec.lua

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ assert(type(after_each) == 'function')
1010
assert(type(spy) == 'table')
1111
assert(type(stub) == 'table')
1212
assert(type(mock) == 'table')
13+
assert(type(match) == 'table')
1314
assert(type(assert) == 'table')
1415

1516
describe('Before each', function()

spec/export_spec.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ describe('tests require "busted"', function()
5050
assert.is_equal(after_each, require 'busted'.after_each)
5151
end)
5252

53-
it('exports assert and mocks', function()
53+
it('exports assert, mocks, and matchers', function()
5454
assert.is_equal(assert, require 'busted'.assert)
5555
assert.is_equal(spy, require 'busted'.spy)
5656
assert.is_equal(mock, require 'busted'.mock)
5757
assert.is_equal(stub, require 'busted'.stub)
58+
assert.is_equal(match, require 'busted'.match)
5859
end)
5960

6061
it('exports publish/subscribe', function()

0 commit comments

Comments
 (0)