Transform body as file (#388)

* .

* fix
This commit is contained in:
Stef Heyenrath
2019-12-06 06:52:08 +01:00
committed by GitHub
parent a47750c058
commit 8bafd6a1ba
12 changed files with 117 additions and 33 deletions

View File

@@ -20,15 +20,19 @@ namespace WireMock.Transformers
_action = action;
}
public IHandlebars Create()
public IHandlebarsContext Create()
{
var handlebarsContext = Handlebars.Create(HandlebarsConfiguration);
var handlebars = Handlebars.Create(HandlebarsConfiguration);
HandlebarsHelpers.Register(handlebarsContext, _fileSystemHandler);
HandlebarsHelpers.Register(handlebars, _fileSystemHandler);
_action?.Invoke(handlebarsContext, _fileSystemHandler);
_action?.Invoke(handlebars, _fileSystemHandler);
return handlebarsContext;
return new HandlebarsContext
{
Handlebars = handlebars,
FileSystemHandler = _fileSystemHandler
};
}
}
}
}