diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-07-19 16:41:52 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-07-19 16:41:52 -0400 |
commit | 82bbb7b09ccf3451033f17b2de9f6f17c030b974 (patch) | |
tree | 6c322819c6ebb3aa8141443c92d86e65761be4d2 /t/lib | |
parent | ff4095d8e4728ddfca51fd01cd138c09d0df4964 (diff) | |
download | catalyst-view-spreadsheet-template-82bbb7b09ccf3451033f17b2de9f6f17c030b974.tar.gz catalyst-view-spreadsheet-template-82bbb7b09ccf3451033f17b2de9f6f17c030b974.zip |
add a basic test
Diffstat (limited to 't/lib')
-rw-r--r-- | t/lib/MyApp.pm | 13 | ||||
-rw-r--r-- | t/lib/MyApp/Controller/Root.pm | 15 | ||||
-rw-r--r-- | t/lib/MyApp/View/Spreadsheet/Template.pm | 9 | ||||
-rw-r--r-- | t/lib/MyApp/root/index.json | 151 |
4 files changed, 188 insertions, 0 deletions
diff --git a/t/lib/MyApp.pm b/t/lib/MyApp.pm new file mode 100644 index 0000000..279ab6a --- /dev/null +++ b/t/lib/MyApp.pm @@ -0,0 +1,13 @@ +package MyApp; +use Moose; +use namespace::autoclean; + +extends 'Catalyst'; + +__PACKAGE__->config( + name => 'MyApp', +); + +__PACKAGE__->setup; + +1; diff --git a/t/lib/MyApp/Controller/Root.pm b/t/lib/MyApp/Controller/Root.pm new file mode 100644 index 0000000..8d02d2b --- /dev/null +++ b/t/lib/MyApp/Controller/Root.pm @@ -0,0 +1,15 @@ +package MyApp::Controller::Root; +use Moose; +use namespace::autoclean; + +BEGIN { extends 'Catalyst::Controller' } + +__PACKAGE__->config(namespace => ''); + +sub index :Path :Args(0) {} + +sub end : ActionClass('RenderView') {} + +__PACKAGE__->meta->make_immutable; + +1; diff --git a/t/lib/MyApp/View/Spreadsheet/Template.pm b/t/lib/MyApp/View/Spreadsheet/Template.pm new file mode 100644 index 0000000..34760bf --- /dev/null +++ b/t/lib/MyApp/View/Spreadsheet/Template.pm @@ -0,0 +1,9 @@ +package MyApp::View::Spreadsheet::Template; +use Moose; +use namespace::autoclean; + +extends 'Catalyst::View::Spreadsheet::Template'; + +__PACKAGE__->meta->make_immutable; + +1; diff --git a/t/lib/MyApp/root/index.json b/t/lib/MyApp/root/index.json new file mode 100644 index 0000000..64fc6e1 --- /dev/null +++ b/t/lib/MyApp/root/index.json @@ -0,0 +1,151 @@ +{ + "selection" : 0, + "worksheets" : [ + { + "cells" : [ + [ + { + "contents" : "Colored Cell", + "format" : { + "bg_color" : "#9BBB59", + "color" : "#FFFF00", + "pattern" : "solid", + "size" : 12 + }, + "type" : "string" + }, + { + "contents" : "Wide Cell (25.00)", + "type" : "string" + }, + { + "contents" : "Bordered Cell w/ Text Wrap", + "format" : { + "border" : [ + "thin", + "thin", + "thin", + "thin" + ], + "border_color" : [ + "#000000", + "#000000", + "#000000", + "#000000" + ], + "text_wrap" : true + }, + "type" : "string" + }, + { + "contents" : "Middle Valigned", + "format" : { + "valign" : "vcenter" + }, + "type" : "string" + }, + { + "contents" : "Right Aligned and text wrapped", + "format" : { + "align" : "right", + "text_wrap" : true + }, + "type" : "string" + } + ], + [ + {}, + {}, + {}, + {}, + {} + ], + [ + { + "contents" : 10, + "type" : "number" + }, + {}, + {}, + {}, + {} + ], + [ + { + "contents" : 20, + "type" : "number" + }, + {}, + {}, + { + "contents" : 2.5, + "format" : { + "num_format" : "\"$\"#,##0.00" + }, + "type" : "number" + }, + { + "contents" : "<< currency cell", + "format" : { + "align" : "center", + "color" : "#4BACC6", + "size" : 12 + }, + "type" : "string" + } + ], + [ + { + "contents" : 30, + "type" : "number" + }, + {}, + {}, + {}, + {} + ], + [ + { + "contents" : 60, + "formula" : "SUM(A3:A5)", + "type" : "number" + }, + { + "contents" : "<< formula cell", + "format" : { + "align" : "right", + "bg_color" : "#EEECE1", + "color" : "#F79646", + "pattern" : "solid", + "size" : 12 + }, + "type" : "string" + }, + {}, + {}, + {} + ] + ], + "column_widths" : [ + 10.83203125, + 25.83203125, + 10, + 15, + 18.1640625 + ], + "name" : "Sheet1", + "row_heights" : [ + 45, + 15, + 15, + 15, + 15, + 15 + ], + "selection" : [ + 3, + 4 + ] + } + ] +} |