Skip Menu |
 

This queue is for tickets about the Bot-BasicBot CPAN distribution.

Report information
The Basics
Id: 27427
Status: resolved
Priority: 0/
Queue: Bot-BasicBot

People
Owner: Nobody in particular
Requestors: daxim [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.7
Fixed in: (no value)



Subject: name method returns wrong
Download (untitled) / with headers
text/plain 167b
Bot::BasicBot 0.7 name method always returns the nick concat " bot" even if name is explicitely set due to a bug in object handling. See attached patch and testcase.
Subject: name.diff
Download name.diff
text/x-diff 269b
--- /usr/lib/perl5/site_perl/5.8.8/Bot/BasicBot.pm +++ Bot/BasicBot.pm @@ -801,7 +801,7 @@ sub name { my $self = shift; $self->{name} = shift if @_; - $_[0]->{name} or $self->nick . " bot"; + $self->{name} or $self->nick . " bot"; } =head2 channels
Subject: name.t
Download name.t
text/x-perl 577b
#!/usr/bin/perl use strict; use warnings; package Buggy; use base qw(Bot::BasicBot); package main; use Test::Simple tests => 2; my $n = 'The Bugged Bot'; { my $b = Buggy->new( server => 'irc.perl.org', channels => ['#doesnotmatter'], nick => 'bugbot', name => $n, ); ok $b->name eq $n, 'name in constructor'; }; { my $b = Buggy->new( server => 'irc.perl.org', channels => ['#doesnotmatter'], nick => 'bugbot', ); $b->name($n); ok $b->name eq $n, 'name as method'; };
Bot::BasicBot 0.8 released, fixes this. Thanks.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.