Acme-CatFS

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

    Holder, and derivatives of that collection of files created through
    textual modification. 
  - "Standard Version" refers to such a Package if it has not been modified,
    or has been modified in accordance with the wishes of the Copyright
    Holder. 
  - "Copyright Holder" is whoever is named in the copyright or copyrights for
    the package. 
  - "You" is you, if you're thinking about copying or distributing this Package.
  - "Reasonable copying fee" is whatever you can justify on the basis of media
    cost, duplication charges, time of people involved, and so on. (You will
    not be required to justify it to the Copyright Holder, but only to the
    computing community at large as a market that must bear the fee.) 
  - "Freely Available" means that no fee is charged for the item itself, though
    there may be fees involved in handling the item. It also means that
    recipients of the item may redistribute it under the same conditions they
    received it. 

1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.

lib/Acme/CatFS.pm  view on Meta::CPAN

use LWP::Simple;
use Fuse::Simple;

use Moo;
use MooX::Options;
use Types::Path::Tiny qw(Dir);

option mountpoint => ( 
  is       => 'ro', 
  isa      => Dir,
  required => 1,
  format   => 's',
  coerce   => Dir->coercion,
  doc      => 'mount point for catfs (should be a directory). Required.',
);

option cat_url => (
  is      => 'ro',
  format  => 's',
  default => sub {
    'http://thecatapi.com/api/images/get?format=src&type=jpg'

t/01-basic.t  view on Meta::CPAN

use Acme::CatFS;

subtest "basic" => sub {
  can_ok 'Acme::CatFS', 'run', 'new', 'new_with_options';

  my $catfs = Acme::CatFS->new(mountpoint => '/');

  isa_ok $catfs, 'Acme::CatFS';
};

subtest "mountpoint should be required" => sub {
  throws_ok {
    Acme::CatFS->new
  }
  qr/mountpoint/,
  'mountpoint should be required';
};

subtest "run should call Fuse::Simple::main and LWP::Simple::get" => sub {
  my $random_cat_pic;

  mock 'LWP::Simple'
    => method 'get'
    => should {
      $random_cat_pic = shift;



( run in 1.075 second using v1.01-cache-2.11-cpan-0a6323c29d9 )