in reply to Failed test of Net::SNTP::Client module

Test cases should always be run from within the module root directory to simulate exactly how CPAN testers does it (ie, the directory that t/ is in: perl t/Net-SNTP-Client.t), especially when using file names and paths as your test data.

It looks like your module might be creating the hash key from a relative directory path or script name, so try changing this line:

'Net-SNTP-Client.t' => {

to:

't/Net-SNTP-Client.t' => {

in the test and see if that fixes it.

-stevieb

Replies are listed 'Best First'.
Re^2: Failed test of Net::SNTP::Client module
by thanos1983 (Parson) on Jul 06, 2015 at 14:36 UTC

    Hello stevieb,

    This is was my first thought also, to add the t/ indicate the directory. I was not quite sure if this was the correct way of solving the problem or not but it seems it worked fine. The only modification that I had to apply was to put the keys in correct order also. Any way details seems to be working just fine. ;)

    Thank you for your time and effort.

    Seeking for Perl wisdom...on the process of learning...not there...yet!

      Indeed, it was the correct fix. The test itself was faulty in this case. I do see now that you were using the script name as a key in the hash ($0 => {), so from the module's perspective when running the tests within the root dir, it would for certain have the t/ prepended to it.

        OMG!!!!! You right!!!!! I completely ignored this factor. I assumed since I am executing the script from inside the directory why not working outside of the directory. Stupidity... :P

        Thanks again it makes absolute sense.

        Seeking for Perl wisdom...on the process of learning...not there...yet!