'use strict'
var matchers = require('./matchers')
var Test = require('./Test')

function dsl (target) {
  Object.assign(target || global, dsl.matchers(), { test: dsl.test })
}

dsl.matchers = () => {
  return Object.keys(matchers).reduce((memo, matcher) => {
    var Class = matchers[matcher]
    memo[matcher.toLowerCase()] = (arg1, arg2) => new Class(arg1, arg2)
    return memo
  }, {})
}

// Use function instead of arrow to support arguments
dsl.test = function (name, subject) {
  return new Test(name, subject, Array.from(arguments).slice(2))
}

module.exports = dsl

@@ -124,34 +124,88 @@
 get 
-%7C%7C global, dsl.matchers(),
+=== undefined ? global : target,%0A                dsl.matchers(),%0A               
  %7B t

Support falsy targets