Finance::IG::REST::Client - Module to mock REST::Client when testing Finance::IG
This module mocks REST::CLient. Rather than sending request via the internet a series of files with names derived from a hash of url and parameters are retrieved and contain the expected respons.
The module is intended to be used with use Package::Alias, see below.
The files can be generated with the module in Testing::Record::REST::Client, but you will need an IG account to run generate files as you will need to really access the IG site.
Version 0.093
use Package::Alias 'REST::Client'=>'Finance::IG::REST::Client' ; use REST::Client;
Or use Package::Alias 'REST::Client'=>'Finance::IG::REST::Client' ; use Some::Other::Module::That::UsesREST::Client'
calls to Some::Other... # All use the mocked REST::Client;
This is a list of the implemented methods. We only implement those needed for testing Finance::IG
No parameters, returns a blessed reference to the item
This function is not implemented in the original REST::Client. It returns a string
This is Finance::IG::REST::Client
so that you may know you have succesfully instantiated the right module.
Mocks the REST::CLient POST function
returns the success response code (200)
returns the mocked content of the response
returns the mocked response header.
Dummy function.
Dummy function, calls POST
To install Finance::IG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Finance::IG
CPAN shell
perl -MCPAN -e shell install Finance::IG
For more information on module installation, please visit the detailed CPAN module installation guide.