From: Robert 'phaylon' Sedlacek Date: Wed, 30 May 2012 19:48:56 +0000 (+0000) Subject: xtests for local sudo connector X-Git-Tag: v0.001001~46 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=985c21e3beb624071999c7d416aa0fd62fa5789d;p=scpubgit%2FObject-Remote.git xtests for local sudo connector --- diff --git a/xt/lib/TestFindUser.pm b/xt/lib/TestFindUser.pm new file mode 100644 index 0000000..8f1133c --- /dev/null +++ b/xt/lib/TestFindUser.pm @@ -0,0 +1,6 @@ +package TestFindUser; +use Moo; + +sub user { $< } + +1; diff --git a/xt/local-sudo.t b/xt/local-sudo.t new file mode 100644 index 0000000..cd0af39 --- /dev/null +++ b/xt/local-sudo.t @@ -0,0 +1,17 @@ +use strictures 1; +use Test::More; +use FindBin; + +use lib "$FindBin::Bin/lib"; + +use Object::Remote; + +my $user = $ENV{TEST_SUDOUSER} + or plan skip_all => q{Requires TEST_SUDOUSER to be set}; + +my $remote = TestFindUser->new::on($user . '@'); +my $remote_user = $remote->user; +like $remote_user, qr/^\d+$/, 'returned an int'; +isnt $remote_user, $<, 'ran as different user'; + +done_testing;