FAQ
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@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

Search Discussions

  • Jonathan Rockway at Feb 10, 2007 at 3:48 am

    On Friday 09 February 2007 21:03, Greg McAlpin wrote:
    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.
    I suggest installing it under Cygwin -- you're going to have lots of trouble
    with the dependencies (Cache::FastMmap isn't going to work, probably) on
    plain Windows. I know for a fact that Angerwhale works fine under Cygwin,
    though; I occasionally do development there.
    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\li
    b\TestApp\root home:
    C:\xampp\perl\cpan\build\Catalyst-Plugin-ConfigLoader-Environment-0.01\t\li
    b\TestApp FOO: foo
    VIEW::TESTVIEW_FOO: Test View's foo!
    Looks like Windows uppercases environment variables, which UNIX doesn't. You
    can safely remove ConfigLoader::Environment from Angerwhale, though -- it's
    only used during the tests and if you're deploying on UNIX and using
    something like envdir for configuration.

    However, suggestions for making ConfigLoader::Environment work cleanly on both
    Windows and UNIX are welcome.

    --
    package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
    $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
    ";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: not available
    Type: application/pgp-signature
    Size: 307 bytes
    Desc: not available
    Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070209/cfd4f428/attachment.pgp
  • Ash Berlin at Feb 10, 2007 at 11:47 am

    Jonathan Rockway wrote:
    On Friday 09 February 2007 21:03, Greg McAlpin wrote:
    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.
    I suggest installing it under Cygwin -- you're going to have lots of trouble
    with the dependencies (Cache::FastMmap isn't going to work, probably) on
    plain Windows. I know for a fact that Angerwhale works fine under Cygwin,
    though; I occasionally do development there.
    http://perlitist.com/articles/Cache::FastMmap%20and%20Win32.pod

    It works fine now
  • Greg McAlpin at Feb 10, 2007 at 5:31 pm
    Date: Sat, 10 Feb 2007 11:47:33 +0000
    From: Ash Berlin
    Subject: Re: [Catalyst] Catalyst::Plugin::ConfigLoader::Environment on
    windows
    To: The elegant MVC web framework
    Message-ID: <45CDB0D5.2020300@firemirror.com>
    Content-Type: text/plain; charset=ISO-8859-1; format=flowed

    Jonathan Rockway wrote:
    On Friday 09 February 2007 21:03, Greg McAlpin wrote:
    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.
    I suggest installing it under Cygwin -- you're going to have lots of trouble
    with the dependencies (Cache::FastMmap isn't going to work, probably) on
    plain Windows. I know for a fact that Angerwhale works fine under Cygwin,
    though; I occasionally do development there.
    http://perlitist.com/articles/Cache::FastMmap%20and%20Win32.pod

    It works fine now

    Thanks Jonathan and Ash. I now have Angerwhale running well enough on Windows to look at how it works, which is all that I wanted.

    Thanks!

    Greg

    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070210/2cbbaf75/attachment.htm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedFeb 10, '07 at 3:03a
activeFeb 10, '07 at 5:31p
posts4
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase