#!/usr/bin/perl -w use strict; use warnings; use Test::More; use Test::Differences; use FindBin qw/$Bin/; use File::Spec::Functions 'catfile'; eval { require JavaScript::Standalone }; plan skip_all => "froodydoc.js needs JavaScript::Standalone" if $@; plan tests => 1; my $bin_script = catfile($Bin, qw/.. bin froodydoc.js/); # ./lib needs to be in the inc path - FOR THE $bin_script process. so set $ENV{PERL5LIB} $ENV{PERL5LIB} = join(":", $ENV{PERL5LIB}||'', catfile($Bin, qw/.. lib/) ); open WIKY, "$bin_script --wiky Froody::API::Reflection|" or die "Unable to open froodydoc.js pipe for reading: $!"; { local $/; eq_or_diff , , "Wiky matches"; } __DATA__ = froody.reflection.getMethodInfo = Returns information for a given froody API method. As long as there is a method matching the given method_name, returns description and usage of that method in xml. == Arguments == [|Name|Type|Description|Required| |method_name|string|The name of the method to fetch information for.|required|] == Response == [% A fake method xml-response-example Your favorite color. Your happy fun clothing of choice. Don't cross the streams. Don't cross the streams. %] == Errors == * *froody.error.notfound.method* - Method not found\\ \\ The requested method was not found. = froody.reflection.getMethods = Returns a list of available froody API methods. == Arguments == None. == Response == [% froody.reflection.getMethods froody.reflection.getMethodInfo bar.baz.blargle heartofgold.towel.location %] = froody.reflection.getErrorTypes = Returns a list of all available froody error types for this repository. == Arguments == None. == Response == [% froody.error froody.error.blog %] = froody.reflection.getErrorTypeInfo = Request information about an Error Type == Arguments == [|Name|Type|Description|Required| |code|string|The code of the error type whose information is being requested.|required|] == Response == [% Internal structure of your error type goes here (including XML) %] == Errors == * *froody.error.notfound.errortype* - Error Type not Found = froody.reflection.getSpecification = Request the full public specification for a froody endpoint. == Arguments == None. == Response == [% A fake method xml-response-example Your favorite color. Your happy fun clothing of choice. Don't cross the streams. Don't cross the streams. A fake method xml-response-example Your favorite color. Your happy fun clothing of choice. Don't cross the streams. Don't cross the streams. Internal structure of your error type goes here (including XML) Internal structure of your error type goes here (including XML) %]