Socialtext::Resting::Mock(3) Fake rester


my $rester = Socialtext::Resting::Mock->(file => 'foo');
# returns content of 'foo'


new( %opts )

Create a new fake rester object. Options:
File to return the contents of.

server( $new_server )

Get or set the server.

username( $new_username )

Get or set the username.

password( $new_password )

Get or set the password.

workspace( $new_workspace )

Get or set the workspace.

get_page( $page_name )

Returns the content of the specified file or the page stored locally in the object.


Retrieve a list of pages in the current workspace.

put_page( $page_name )

Stores the page content in the object.

put_pagetag( $page, $tag )

Stores the page tags in the object.

get_pagetags( $page )

Retrieves page tags stored in the object.

die_on_put( $rc )

Tells the next put_page() to die with the supplied return code.

accept( $mime_type )

Stores the requested mime type.

order( $order )

Stores the requested order.

get_taggedpages( $tag )

Retrieves the taggedpages stored in the object.

set_taggedpages( $tag, $return )

Store the taggedpages return value in the object.

This is not a real function, but it can make testing easier.


Set the json_verbose flag.


Retrieve a fake response object.


Luke Closs, "<luke.closs at>"


Copyright 2006 Luke Closs, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.