Skip Menu |

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

Report information
The Basics
Id: 14556
Status: resolved
Priority: 0/
Queue: Test-Cmd

People
Owner: knight [...] baldmt.com
Requestors: mpettigrew [...] transdimension.com
Cc:
AdminCc:

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



Subject: inconsistent chdir between Test::Cmd::Common and Test::Cmd
There appears to be an inconsistency between the changing of directories when calling Test::Cmd::Common::new versus Test::Cmd::new. Test::Common::new changes the working directory per the 'working_dir' definition but it doesn't store the current working directory in $self->{'cwd'} like Test::Cmd::new. This means when $self->cleanup() is called in a script it won't change directory back to the original cwd. Looking at Common::new & Cmd::new I see that the problem is more subtle than I've described above but you get the idea. Essentially, it should still be possibly to revert back to the original cwd when cleanup() is called in an object created by Test::Common::new().
Can we please have an updated status for this error.
This is working as designed. The Test::Cmd layer takes care of temp directory creation and cd'ing back to origin for cleanup, and the Test::Cmd::Common subclass relies on the base class to handle the chdir back to origin. Since the subclass has no independent cleanup() method, it doesn't need to record its own 'cwd' attribute. If the current behavior is actually causing a problem, please specify the use case that demonstrates the problematic behavior. Thanks,