Permalink
Browse files

add Types for checking verbs and types in parsers

  • Loading branch information...
1 parent 75a1d65 commit 5f2cb8d9768c9b4a1d3d32b8922917de163e3db5 Steve Ivy committed Aug 17, 2010
Showing with 35 additions and 0 deletions.
  1. +19 −0 lib/ActivityStreams/Types.pm
  2. +16 −0 t/07-verbs-types.t
@@ -2,4 +2,23 @@
package ActivityStreams::Types;
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(VERBS TYPES);
+
# placeholder -- enumerators for verbs and object types
+
+my $schema_uri = 'http://activitystrea.ms/schema/1.0/';
+my @verbs = qw(favorite follow like make-friend join play post save share tag update);
+
+my $VERBS = { map { +"$schema_uri$_" => $_ } @verbs };
+
+my @types =
+ qw(article audio bookmark comment file folder group list note person photo photo-album place playlist product review service status video);
+
+my $TYPES = { map { +"$schema_uri$_" => $_ } @types };
+
+sub VERBS {$VERBS}
+sub TYPES {$TYPES}
+
+1;
View
@@ -0,0 +1,16 @@
+#!/usr/bin/env perl
+use lib qw(lib ../lib);
+
+use strict;
+use warnings;
+use Carp::Always;
+
+use Test::More qw(no_plan);
+
+use ActivityStreams::Types qw(VERBS TYPES);
+
+diag explain VERBS();
+diag explain TYPES();
+
+is( ref VERBS(), 'HASH', 'VERBS is a hashref' );
+is( ref TYPES(), 'HASH', 'TYPES is a hashref' );

0 comments on commit 5f2cb8d

Please sign in to comment.