Dredd::Hooks - Handler for running Hook files for Dredd
use Dredd::Hooks; my $hook_runner = Dredd::Hooks->new(hook_files => [...]); my $hook_runner->$event."_hook"
Dredd::Hooks provides the code to actually run the hooks used in the Dredd API testing suite.
Unless you are righting your own TCP server to accept Dredd Hook requests then you likely want Dredd::Hooks::Methods which describes how to write Dredd Hook files.
An arrayref of fully expanded file names that will be required and should contain hook code.
See Dredd::Hooks::Methods for information on creating these files
Runs hooks for the BeforeEach event from Dredd. This then calls the before_hook before returning. This is because the before event is not an event directly called by dredd.
Runs the before event hooks and returns the modified transaction object
NOTE: This is currently run by the beforeEach handler as the before event is not an event directly sent from Dredd.
Handles the beforeEachValidation event from Dredd. This then calls the beforeValidation_hook to handle the beforeValidation event.
Handles the beforeValidation event and returns the modified transaction.
NOTE: This event is called from beforeEachValidation_hook as it is not and event directly run from Dredd.
Handles the afterEach event from Dredd. Runs the after_hook handler first before running hooks for this event.
Handles the after event and returns the modified transaction.
NOTE: This event is called from the afterEach_hook as it is not and event directly run from Dredd.
Handles the beforeAll event from Dredd. Receives an arrayref of transaction hashrefs and returns the modified version.
Handles the afterAll event from Dredd. Receives an arrayref of transaction hashrefs and returns the modified version.
This modules source is stored in GitHub and any issues or suggestions should be posted there.
Copyright (C) Mike Eve.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Mike Eve <ungrim97@gmail.com>
To install Dredd::Hooks, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dredd::Hooks
CPAN shell
perl -MCPAN -e shell install Dredd::Hooks
For more information on module installation, please visit the detailed CPAN module installation guide.