Skip Menu |

This queue is for tickets about the Class-MOP CPAN distribution.

Report information
The Basics
Id: 47119
Status: resolved
Priority: 0/
Queue: Class-MOP

People
Owner: Nobody in particular
Requestors: amoore [...] mooresystems.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.86
Fixed in: 0.87



Subject: t/310_immutable_destroy.t depends on Moose, and fails if an old Moose is installed
I have Moose 0.7 installed, and when I run the t/310_immutable_destroy.t test, I get a test failure. Here's the output: t/310_immutable_destroy.t ................. Class::MOP::subname is deprecated. Please use Sub::Name directly. at /usr/local/share/perl/5.10.0/Moose/Meta/TypeConstraint.pm line 248 Class::MOP::subname is deprecated. Please use Sub::Name directly. at /usr/local/share/perl/5.10.0/Moose/Meta/TypeConstraint.pm line 248 Class::MOP::subname is deprecated. Please use Sub::Name directly. at /usr/local/share/perl/5.10.0/Moose/Meta/TypeConstraint.pm line 235 Class::MOP::subname is deprecated. Please use Sub::Name directly. at /usr/local/share/perl/5.10.0/Moose/Meta/TypeConstraint.pm line 235 Class::MOP::subname is deprecated. Please use Sub::Name directly. at /usr/local/share/perl/5.10.0/Moose/Meta/TypeConstraint.pm line 235 Class::MOP::subname is deprecated. Please use Sub::Name directly. at /usr/local/share/perl/5.10.0/Moose/Meta/TypeConstraint.pm line 235 t/310_immutable_destroy.t ................. 1/1 # Failed test 'Class::MOP::Class should not override an existing DESTROY method' # at t/310_immutable_destroy.t line 28. # got: undef # expected: 'SUSAN' # Looks like you failed 1 test of 1. t/310_immutable_destroy.t ................. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests Test Summary Report ------------------- t/310_immutable_destroy.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=70, Tests=2140, 13 wallclock secs ( 0.92 usr 0.22 sys + 8.92 cusr 1.04 csys = 11.10 CPU) Result: FAIL Failed 1/70 test programs. 1/2140 subtests failed. make: *** [test_dynamic] Error 1 After some discussion in #moose, a recommended fix is to add a version requirement to the 'use Moose' call. A better fix for the long term may be to not have any CMOP tests depend on Moose.
attaching patch.
From f6d801a0d846a52beb59adf4bb48cd15c30a1840 Mon Sep 17 00:00:00 2001 From: Andrew Moore <amoore@mooresystems.com> Date: Thu, 18 Jun 2009 11:49:18 -0500 Subject: [[rt.cpan.org #47119]] fixing test suite to address RT ticket 47119 changing test to require a specific version of Moose. Old versions of Moose would make the tests fail. Now they're skipped. --- t/310_immutable_destroy.t | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/t/310_immutable_destroy.t b/t/310_immutable_destroy.t index 0cae21f..8f54dbe 100644 --- a/t/310_immutable_destroy.t +++ b/t/310_immutable_destroy.t @@ -1,11 +1,12 @@ use strict; use warnings; -use Test::More tests => 1; +use Test::More tests => 2; use Class::MOP; SKIP: { - unless (eval { require Moose; 1 }) { - skip 'This test requires Moose', 1; + unless (eval { require Moose; Moose->VERSION(0.72); 1 }) { + diag( $@ ); + skip 'This test requires Moose 0.72', 2; exit 0; } @@ -13,7 +14,7 @@ SKIP: { local $SIG{__WARN__} = sub {}; eval <<'EOF'; package FooBar; - use Moose; + use Moose 0.72; has 'name' => ( is => 'ro' ); @@ -23,6 +24,8 @@ SKIP: { EOF } + ok( ! $@, 'evaled FooBar package' ) + or diag( $@ ); my $f = FooBar->new( name => 'SUSAN' ); is( $f->DESTROY, 'SUSAN', -- 1.6.3.1
Subject: Re: [rt.cpan.org #47119] t/310_immutable_destroy.t depends on Moose, and fails if an old Moose is installed
Date: Thu, 18 Jun 2009 12:37:20 -0500 (CDT)
To: "amoore [...] mooresystems.com via RT" <bug-Class-MOP [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Thu, 18 Jun 2009, amoore@mooresystems.com via RT wrote: Show quoted text
> Queue: Class-MOP > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47119 > > > attaching patch.
Really, this test should use a custom inline class to simulate what Moose does in Moose::Meta::Method::Destructor. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/