diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7224150 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: perl +perl: + - "5.16" +script: + perl Build.PL && ./Build build && cover -test -report coveralls diff --git a/Build.PL b/Build.PL new file mode 100644 index 0000000..14cc487 --- /dev/null +++ b/Build.PL @@ -0,0 +1,29 @@ +use strict; +use warnings; +use Module::Build; + +my $builder = Module::Build->new( + module_name => 'ToopherAPI', + license => 'perl', + dist_abstract => 'ToopherAPI - Toopher API wrapper in Perl', + dist_author => 'Toopher ', + dist_version => '1.0.0', + build_requires => { + 'Test::More' => 0, + 'Test::Exception' => 0, + 'Devel::Cover::Report::Coveralls' => 0, + 'HTTP::Request::Common' => 0, + 'JSON' => 0, + 'LWP::UserAgent' => 0, + 'LWP::Protocol::https' => 0, + 'Net::OAuth::ConsumerRequest' => 0, + 'Class::Struct' => 0, + 'URI::Escape' => 0, + 'Try::Tiny' => 0, + 'HTTP::Response' => 0, + 'URI' => 0, + 'URL::Encode' => 0 + }, +); + +$builder->create_build_script(); diff --git a/t/01sanity.t b/t/01sanity.t index 8647fdd..222a078 100644 --- a/t/01sanity.t +++ b/t/01sanity.t @@ -13,7 +13,8 @@ my $ua = eval { use HTTP::Response; use URI; use URL::Encode qw ( url_params_mixed ); - sub new { + sub new + { my ($class) = @_; my $self = { '_response' => new HTTP::Response(200), @@ -44,8 +45,6 @@ my $ua = eval { }->new($code, $message); - - my $api = new ToopherAPI(key => 'foo', secret => 'bar', ua => $ua); subtest 'test version UA string' => sub { @@ -99,7 +98,6 @@ subtest 'authenticate with otp' => sub { is($ua->request->{'post_data'}->{'otp'}, '123456'); }; - subtest 'authentication status' => sub { $ua->response->content('{"id":"1", "pending":false, "granted":true, "automated":false, "reason":"its a test", "terminal":{"id":"1", "name":"test terminal"}}'); my $auth_request = $api->get_authentication_status('1'); @@ -210,5 +208,3 @@ subtest 'unauthorized pairing raises correct error' => sub { }; done_testing(); - -# vim: ts=2:sw=2:expandtab:autoindent