App-Filite-Client
view release on metacpan or search on metacpan
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: App-Filite-Client
Upstream-Contact: Toby Inkster (TOBYINK) <tobyink@cpan.org>
Source: https://metacpan.org/release/App-Filite-Client
Files: INSTALL
LICENSE
examples/config.json
t/share/config.json
t/share/file.txt
t/share/image.png
Copyright: Unknown
License: Unknown
Files: Changes
META.json
META.yml
bin/filite-client
dist.ini
doap.ttl
Copyright: Copyright 2023 Toby Inkster.
SIGNATURE
bin/filite-client
dist.ini
doap.ttl
examples/config.json
lib/App/Filite/Client.pm
t/00start.t
t/01basic.t
t/share/config.json
t/share/file.txt
t/share/image.png
t/unit/App/Filite/Client.t
SHA256 7db9439b4a93415f2a1c32ab5144322abe785f3744695b860e19a47e2422d206 README
SHA256 9f8ce7e5d66319c9c9bc37585aaec8193710557360c3282b9bf27f4a9f05603c bin/filite-client
SHA256 45d34a2ad309ce5583aad4301ee46a65b23efc983acacd1c28d96d466c9a5187 dist.ini
SHA256 1fa12f7c285ad78bfbec5276453ef948476e129818d5a02d90f3465d559bfe14 doap.ttl
SHA256 383a21cf171bd68d44e537b9dcd7dc804789eef220bb28f7be3c66b7f93d3abf examples/config.json
SHA256 b92bc0c23f47fc550276ee3e37da674f1552e959c9bd0e423f8fa61acd03545d lib/App/Filite/Client.pm
SHA256 1d3d4e15244c79bad47183ce0a312ba516c501910e9a11338f42101355bd9026 t/00start.t
SHA256 2e1b76b082b699c9ab5e6bd285fe6be14a6a67570d0111ba9cc75f9439ed4092 t/01basic.t
SHA256 383a21cf171bd68d44e537b9dcd7dc804789eef220bb28f7be3c66b7f93d3abf t/share/config.json
SHA256 6472bf692aaf270d5f9dc40c5ecab8f826ecc92425c8bac4d1ea69bcbbddaea4 t/share/file.txt
SHA256 6e678916223daf59ed89d3dc89a5d82a20502f3addeb9ab2f5b9febb110ddffa t/share/image.png
SHA256 4be77a0dff891e5a59cadfb0e4109e74ad206ba421a9d2f2906b2868cbd5bf6e t/unit/App/Filite/Client.t
-----BEGIN PGP SIGNATURE-----
iF0EAREDAB0WIQRVJKj/4+s6z4WzNujOv4Eoaip9OQUCZByfxAAKCRDOv4Eoaip9
ObxwAJsGegiTXYxGYVQMtWSW+KqYBbNJ6gCeKSgi2NTmHCtMs4S9DjMOVQ/aVr8=
=BLlk
-----END PGP SIGNATURE-----
t/unit/App/Filite/Client.t view on Meta::CPAN
};
case 'simple text' => sub {
@input = ( "$SHARE/file.txt", {} );
@urls = ( 'http://example.net/t/foo' );
$expected_result = $urls[0];
$expected_calls = [ [ share_text => @input ] ];
};
case 'simple file' => sub {
@input = ( "$SHARE/image.png", {} );
@urls = ( 'http://example.net/f/foo' );
$expected_result = $urls[0];
$expected_calls = [ [ share_file => @input ] ];
};
case 'simple link' => sub {
@input = ( "http://www.forward.example/", {} );
@urls = ( 'http://example.net/l/foo' );
$expected_result = $urls[0];
$expected_calls = [ [ share_link => @input ] ];
};
case 'force text' => sub {
@input = ( "$SHARE/image.png", { text => 1 } );
@urls = ( 'http://example.net/t/foo' );
$expected_result = $urls[0];
$expected_calls = [ [ share_text => @input ] ];
};
case 'force file' => sub {
@input = ( "$SHARE/file.txt", { file => 1 } );
@urls = ( 'http://example.net/f/foo' );
$expected_result = $urls[0];
$expected_calls = [ [ share_file => @input ] ];
};
case 'force link' => sub {
@input = ( "$SHARE/image.png", { link => 1 } );
@urls = ( 'http://example.net/t/foo' );
$expected_result = $urls[0];
$expected_calls = [ [ share_link => @input ] ];
};
case 'imply text' => sub {
@input = ( "$SHARE/image.png", { highlight => 1 } );
@urls = ( 'http://example.net/t/foo' );
$expected_result = $urls[0];
$expected_calls = [ [ share_text => @input ] ];
};
tests 'it works' => sub {
my $object = $CLASS->new( server => 'example.com', password => 1 );
my $result = $object->share( @input );
is( $result, $expected_result, 'result' );
is( \@calls, $expected_calls, 'calls' );
t/unit/App/Filite/Client.t view on Meta::CPAN
@args = @_;
return { success => 1, content => 'abc' };
},
];
my $object = $CLASS->new(
useragent => $mock,
server => 'example.org',
password => 'xyz',
);
my $got = $object->share_file( "$SHARE/image.png", {} );
is( $got, 'http://example.org/f/abc', 'result' );
is(
\@args,
array {
item string 'http://example.org/f';
item hash { etc; };
end;
},
'args',
( run in 1.168 second using v1.01-cache-2.11-cpan-df04353d9ac )