Skip Menu |

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

Report information
The Basics
Id: 76930
Status: rejected
Priority: 0/
Queue: Class-Load

People
Owner: Nobody in particular
Requestors: xenoterracide [...] gmail.com
Cc:
AdminCc:

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



Subject: load_class_ok
Date: Tue, 1 May 2012 19:40:02 -0500
To: bugs-class-load [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
I'd like to set a function that would allow me to write my $class = load_class_ok('Class::Foo'); # or throw exception with the original error message perhaps it'd have to be in some kind of Test::Class::Load or something, but this would be useful for test suites. If it's desired perhaps I can take a crack at implementation. -- Caleb Cushing http://xenoterracide.com
Subject: Re: [rt.cpan.org #76930] load_class_ok
Date: Tue, 1 May 2012 19:47:23 -0500
To: Caleb Cushing via RT <bug-Class-Load [...] rt.cpan.org>
From: Jesse Luehrs <doy [...] cpan.org>
On Tue, May 01, 2012 at 08:40:16PM -0400, Caleb Cushing via RT wrote: Show quoted text
> I'd like to set a function that would allow me to write > > my $class = load_class_ok('Class::Foo'); # or throw exception with > the original error message > > perhaps it'd have to be in some kind of Test::Class::Load or > something, but this would be useful for test suites. If it's desired > perhaps I can take a crack at implementation.
How is this any different from load_class()? If the only difference is that it returns the class name, I don't think that load_class_ok() is a reasonable name for it (_ok typically implies a testing function of some sort), and I also don't really see why it needs to be a separate function. If that isn't the only difference, you should explain the differences better. -doy
Subject: Re: [rt.cpan.org #76930] load_class_ok
Date: Tue, 1 May 2012 19:50:40 -0500
To: bug-Class-Load [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
On Tue, May 1, 2012 at 7:47 PM, Jesse Luehrs via RT <bug-Class-Load@rt.cpan.org> wrote: Show quoted text
> ow is this any different from load_class()? If the only difference is > that it returns the class name, I don't think that load_class_ok() is a > reasonable name for it (_ok typically implies a testing function of some > sort), and I also don't really see why it needs to be a separate > function. If that isn't the only difference, you should explain the > differences better.
sorry the intention here would be to actually have this as a testing function using Test::Builder -- Caleb Cushing http://xenoterracide.com
Subject: Re: [rt.cpan.org #76930] load_class_ok
Date: Tue, 1 May 2012 19:53:30 -0500
To: Caleb Cushing via RT <bug-Class-Load [...] rt.cpan.org>
From: Jesse Luehrs <doy [...] cpan.org>
On Tue, May 01, 2012 at 08:50:49PM -0400, Caleb Cushing via RT wrote: Show quoted text
> Queue: Class-Load > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=76930 > > > On Tue, May 1, 2012 at 7:47 PM, Jesse Luehrs via RT > <bug-Class-Load@rt.cpan.org> wrote:
> > ow is this any different from load_class()? If the only difference is > > that it returns the class name, I don't think that load_class_ok() is a > > reasonable name for it (_ok typically implies a testing function of some > > sort), and I also don't really see why it needs to be a separate > > function. If that isn't the only difference, you should explain the > > differences better.
> > sorry the intention here would be to actually have this as a testing > function using Test::Builder
Again, why is this any better than just load_class()? An exception will cause the test to fail anyway. Most people recommend against using use_ok from Test::More for this reason. -doy
Subject: Re: [rt.cpan.org #76930] load_class_ok
Date: Tue, 1 May 2012 20:21:47 -0500
To: bug-Class-Load [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
On Tue, May 1, 2012 at 7:53 PM, Jesse Luehrs via RT <bug-Class-Load@rt.cpan.org> wrote: Show quoted text
> Again, why is this any better than just load_class()? An exception will > cause the test to fail anyway. Most people recommend against using > use_ok from Test::More for this reason.
this comes from my grand desire to be able to write something like my $obj = new_ok( load_class_ok('Foo') => [{ ... } ] ); but to be fair this is much less necessary and is more of a it'd be nice to have than have to. This may be less of a good idea... -- Caleb Cushing http://xenoterracide.com
Subject: Re: [rt.cpan.org #76930] load_class_ok
Date: Tue, 1 May 2012 20:25:45 -0500
To: Caleb Cushing via RT <bug-Class-Load [...] rt.cpan.org>
From: Jesse Luehrs <doy [...] tozt.net>
On Tue, May 01, 2012 at 09:21:58PM -0400, Caleb Cushing via RT wrote: Show quoted text
> Queue: Class-Load > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=76930 > > > On Tue, May 1, 2012 at 7:53 PM, Jesse Luehrs via RT > <bug-Class-Load@rt.cpan.org> wrote:
> > Again, why is this any better than just load_class()? An exception will > > cause the test to fail anyway. Most people recommend against using > > use_ok from Test::More for this reason.
> > this comes from my grand desire to be able to write something like > > my $obj = new_ok( load_class_ok('Foo') => [{ ... } ] ); > > but to be fair this is much less necessary and is more of a it'd be > nice to have than have to. This may be less of a good idea...
If load_class() is modified to return the class name as in the other ticket, then my $obj = new_ok( load_class('Foo') => [{ ... }] ); should be entirely sufficient. -doy
Subject: Re: [rt.cpan.org #76930] load_class_ok
Date: Tue, 1 May 2012 20:28:29 -0500
To: bug-Class-Load [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
On Tue, May 1, 2012 at 8:25 PM, Jesse Luehrs via RT <bug-Class-Load@rt.cpan.org> wrote: Show quoted text
> If load_class() is modified to return the class name as in the other > ticket, then > >  my $obj  = new_ok( load_class('Foo') => [{ ... }] ); > > should be entirely sufficient.
that's true, I can't say I would complain about that. -- Caleb Cushing http://xenoterracide.com