File: attach_group_nodup.t

package info (click to toggle)
libcpan-changes-perl 0.500005-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,964 kB
  • sloc: perl: 988; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 581 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
use strict;
use warnings;

use Test::More;

# ABSTRACT: Ensure duplicates are not created with the same group name.

use CPAN::Changes::Release;
use CPAN::Changes::Group;

my $group = CPAN::Changes::Group->new( name => 'GroupName' );
$group->add_changes("This is a test");

my $dup = CPAN::Changes::Group->new( name => 'GroupName' );
$group->add_changes("This is also a test");

my $release = CPAN::Changes::Release->new();
$release->attach_group($group);
$release->attach_group($dup);

my @groups = $release->groups;

is( scalar @groups, 1, 'Only 1 group added' );

done_testing;