 
     callback()
 
-  this.Given /^I dress the following JSON document with (.*?):$/, (type, doc, callback) ->
+  @Given /^I dress the following JSON document with (.*?):$/, (type, doc, callback) ->
     try
       json = JSON.parse(doc)
       result = system.fetch(type).dress(json)


    callback()

  this.Given /^I dress the following JSON document:$/, (doc, callback) ->
    try
      json = JSON.parse(doc)
      result = system.dress(json)


module.exports = ->

  @Before (callback)->
    TestSystem ?= require '../support/test_system'
    system = TestSystem
    callback()

  @Given /^the System is$/, (source, callback) ->
    try
      system = TestSystem.parse(source)
    catch e
