aboutsummaryrefslogtreecommitdiff
path: root/t/01-config.t
diff options
context:
space:
mode:
Diffstat (limited to 't/01-config.t')
-rw-r--r--t/01-config.t25
1 files changed, 24 insertions, 1 deletions
diff --git a/t/01-config.t b/t/01-config.t
index b0261df..5a3e6b7 100644
--- a/t/01-config.t
+++ b/t/01-config.t
@@ -44,11 +44,20 @@ is_deeply(
[$resources[0]->get_collections()],
[],
'no collections');
+
+is(WebCoso::Config->get_pipeline_for($resources[0]),
+ 'WebCoso::Pipeline::Id',
+ 'si segna le pipeline');
+
+throws_ok {
+ WebCoso::Config->get_pipeline_for('not-a-resource')
+ }
+ 'WebCoso::X::NoSuchResource',
+ 'muore se gli si chiede una risorsa ignota';
}
WebCoso::Config->clear();
-
{
my $conf_file=<<'EOF';
res('src/file1.rest.txt','src/nonce.rest.txt','Id','dst/file.html');
@@ -292,3 +301,17 @@ is_deeply(
[$resources[0]],
'aggancio c->r');
}
+
+WebCoso::Config->clear();
+
+{
+my $conf_file=<<'EOF';
+res('src/file1.rest.txt','NoSuchPipeline','dst/file.html');
+EOF
+
+throws_ok {
+ WebCoso::Config->read_scalar($conf_file,"$thisdir/config-in-test")
+ }
+ 'WebCoso::X::ConfigError',
+ 'muore se la pipeline รจ ignota';
+}