File: 24-transaction.t

package info (click to toggle)
librt-client-rest-perl 1%3A0.72-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 588 kB
  • sloc: perl: 4,883; makefile: 9
file content (43 lines) | stat: -rw-r--r-- 864 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!perl
# vim:ft=perl:

use strict;
use warnings;

use Test::More tests => 23;
use Test::Exception;

use constant METHODS => (
    'new', 'to_form', 'from_form', 'rt_type',

    # attrubutes:
    'id',          'creator',    'type',  'old_value', 'new_value', 'parent_id',
    'attachments', 'time_taken', 'field', 'content',   'created',
    'description', 'data',
);

BEGIN {
    use_ok('RT::Client::REST::Transaction');
}

for my $method (METHODS) {
    can_ok( 'RT::Client::REST::Transaction', $method );
}

my $tr;

lives_ok {
    $tr = RT::Client::REST::Transaction->new;
}
'Transaction can get successfully instantiated';

for my $method (qw(store search count)) {
    throws_ok {
        $tr->$method;
    }
    'RT::Client::REST::Object::IllegalMethodException',
      "method '$method' should throw an exception";
}

ok( 'transaction' eq $tr->rt_type );