On Apr 12, 2005, at 3:58 PM, James E Keenan wrote:
How do you test that a variable has been tied to a class?
I looked through Test::More; the term 'tie' is conspicuous by its absence. I also searched the archives of this list and couldn't locate anything.
I'm looking for something along the lines of Test::More::isa_ok that we could use like this where the 'tie' call does not (at least in normal practice) explicitly return an object:
use Tie::File; tie @data, 'Tie::File', $file or die; is_tied(@data, $file, "[EMAIL PROTECTED] is tied to \$file");
in most cases,
isa_ok(tied $data, 'Tie::File')
should work, I think. There's no generic way to check the additional arguments like you are trying to do.
-kevin