[Catalyst] Catalyst::Plugin::ConfigLoader::Environment on windows

Greg McAlpin gmcalpin at sbcglobal.net
Sat Feb 10 03:03:36 GMT 2007


Hi.
   
  Trying to install Angerwhale and running into a problem with one of the tests for Catalyst::Plugin::ConfigLoader::Environment.  I hope that it's okay to post this to this list.  I would appreciate any help.
   
  The test (01-live.t) expects to find hash keys like 'foo' and 'bar' and 'foo_bar_baz'.  Instead, they are all uppercase ('FOO' and 'BAR' and 'FOO_BAR_BAZ').
   
  I modified the test to print the contents of the hashref named "$config" to a file.
  Here is the modified test case, the result of 'make test', and the file with the values of $config.
   
  --- Modified content of test 01-live.t:
  C:\xampp\perl\cpan\build\Catalyst-Plugin-ConfigLoader-Environment-0.01\t>cat 01-live.t
#!/usr/bin/perl
# 01-live.t
# Copyright (c) 2006 Jonathan Rockway <jrockway at cpan.org>
  use Test::More tests => 7;
use FindBin qw($Bin);
use lib "$Bin/lib";
BEGIN {
    $ENV{TESTAPP_foo} = 'foo';
    $ENV{TESTAPP_bar} = 'bar';
    $ENV{TESTAPP_foo_bar_baz} = 'quux';
    $ENV{TESTAPP_View::TestView_foo} = "Test View's foo!";
}
  use Catalyst::Test 'TestApp';
  ok(my $r = request('/'), 'request /');
ok($r->is_success, 'that worked');
  my $config = eval $r->content;
ok(ref $config, 'got config');
  #
# See what $config contains.
#
open my $ofh, ">", "test01.txt" || die $!;
foreach my $key (keys %{$config}) {
    print $ofh "$key:  " . $config->{$key} . "\n";
}
close $ofh;
  
is($config->{foo}, 'foo', 'got foo');
is($config->{bar}, 'bar', 'got bar');
is($config->{foo_bar_baz}, 'quux', 'got foo_bar_baz');
  my $view = get('/foo');
is($view, "Test View's foo!", 'got View::TestView->foo');
   
  --- Result of make test:
   
  C:\xampp\perl\cpan\build\Catalyst-Plugin-ConfigLoader-Environment-0.01>nmake test
  Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.
          C:\xampp\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib\lib', 'blib\arch')" t/00-load.t t/01-live.t t/boilerplate.t t/pod-coverage.t t/pod.t
t/00-load.........ok 1/1# Testing Catalyst::Plugin::ConfigLoader::Environment 0.01, Perl 5.008008, C:\xampp\perl\bin\perl.exe
t/00-load.........ok
t/01-live.........ok 1/7
t/01-live.........NOK 4#   Failed test 'got foo'
#   at t/01-live.t line 33.
#          got: undef
#     expected: 'foo'
  t/01-live.........NOK 5#   Failed test 'got bar'
#   at t/01-live.t line 34.
#          got: undef
#     expected: 'bar'
  t/01-live.........NOK 6#   Failed test 'got foo_bar_baz'
#   at t/01-live.t line 35.
#          got: undef
#     expected: 'quux'
Use of uninitialized value in print at C:/xampp/perl/site/lib/Catalyst/Engine.pm
 line 583.
t/01-live.........NOK 7
#   Failed test 'got View::TestView->foo'
#   at t/01-live.t line 38.
#          got: ''
#     expected: 'Test View's foo!'
# Looks like you failed 4 tests of 7.
t/01-live.........dubious
        Test returned status 4 (wstat 1024, 0x400)
DIED. FAILED tests 4-7
        Failed 4/7 tests, 42.86% okay
t/boilerplate.....ok
t/pod-coverage....ok
t/pod.............ok
Failed Test Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/01-live.t    4  1024     7    4  57.14%  4-7
Failed 1/5 test scripts, 80.00% okay. 4/13 subtests failed, 69.23% okay.
NMAKE : fatal error U1077: 'C:\xampp\perl\bin\perl.exe' : return code '0xff'
Stop.
   
  --- The actual values of $config:
   
  C:\xampp\perl\cpan\build\Catalyst-Plugin-ConfigLoader-Environment-0.01>cat test01.txt
BAR:  bar
FOO_BAR_BAZ:  quux
root:  C:\xampp\perl\cpan\build\Catalyst-Plugin-ConfigLoader-Environment-0.01\t\lib\TestApp\root
home:  C:\xampp\perl\cpan\build\Catalyst-Plugin-ConfigLoader-Environment-0.01\t\lib\TestApp
FOO:  foo
VIEW::TESTVIEW_FOO:  Test View's foo!

Thanks!
   
  Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070209/e3e23d13/attachment.htm


More information about the Catalyst mailing list