Skip Menu |

This queue is for tickets about the Test-MockObject CPAN distribution.

Report information
The Basics
Id: 25479
Status: new
Priority: 0/
Queue: Test-MockObject

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

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



Subject: Generating spurious warnings only in the debugger
The following test script passes if run via prove, but fails if run in the debugger. #!/usr/bin/perl # Tests that Test::MockObject obeys the correct behaviour BEGIN { $| = 1; $^W = 1; } use strict; use Test::More tests => 8; use Params::Util '_INSTANCE'; use Test::MockObject::Extends; SCOPE: { package Foo; sub new { bless {}, $_[0]; } sub dummy { 0 } } # Set a warning counter my $warning_count = 0; $SIG{__WARN__} = sub { $warning_count++ }; my $object = Foo->new; isa_ok( $object, 'Foo' ); is( $warning_count, 0, 'No warnings' ); my $mock = Test::MockObject::Extends->new( $object ); isa_ok( $mock, 'Foo' ); is( $warning_count, 0, 'No warnings' ); # Positive case if ( _INSTANCE($mock, 'Foo') ) { pass( "_INSTANCE(true) returned true" ); } else { fail( "_INSTANCE(true) returned false" ); } is( $warning_count, 0, 'No warnings' );