How can I use a Perl machine or TDD platform?

How do I test a function or module depending on a machine or platform? For example, is something that looks / depends on $^Oor a module such as Net :: Ifconfig :: Wrapper ? I do not need to verify that Net :: Ifconfig :: Wrapper returns the correct values, but I need to check whether I am doing this correctly with these values.

Thanks!

EDIT: Testing $^Oturned out to be easier than I thought:

{
    # <~> $ perl -e 'print $^O'
    # linux

    local $^O = 'linux';
    $rc = GetOSType();
    is($rc, $OS_LINUX, 'OS Check - linux');
}

For some reason, I thought it was a read-only variable.

+5
source share
2 answers
+5

mock objects, "" .

, , , .

+3

All Articles