Catalyst::Test configuration questions

View: New views
5 Messages — Rating Filter:   Alert me  

Catalyst::Test configuration questions

by Evan Carroll-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My latest project, a Craigslist posting tool, is configured through
the applications yaml conf file. I'm looking for a way to test based
the conf file with Catalyst::Test. Any idea of how to accomplish this?

--
Evan Carroll
System Lord of the Internets

_______________________________________________
List: Catalyst@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: Catalyst::Test configuration questions

by Devin Austin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Mon, Oct 26, 2009 at 3:51 PM, Evan Carroll <lists@...> wrote:
My latest project, a Craigslist posting tool, is configured through
the applications yaml conf file. I'm looking for a way to test based
the conf file with Catalyst::Test. Any idea of how to accomplish this?

--
Evan Carroll
System Lord of the Internets

_______________________________________________
List: Catalyst@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

So, you want your tests to be configured based on a yaml config file? Or you want to base your tests off of a yaml config file?

--
Devin Austin
http://www.codedright.net
9702906669 - Cell

_______________________________________________
List: Catalyst@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: Catalyst::Test configuration questions

by Andrew Rodland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday 26 October 2009 04:51:57 pm Evan Carroll wrote:
> My latest project, a Craigslist posting tool, is configured through
> the applications yaml conf file. I'm looking for a way to test based
> the conf file with Catalyst::Test. Any idea of how to accomplish this?
>
You're gonna need some
http://dl.getdropbox.com/u/129905/specialized-hardware.jpg for that.

Andrew

_______________________________________________
List: Catalyst@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: Catalyst::Test configuration questions

by Evan Carroll-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> So, you want your tests to be configured based on a yaml config file? Or you
> want to base your tests off of a yaml config file?

I'm not sure there is a difference as you word it.

I want to dynamically modify the configuration of my application for
the purpose of testing. That configuration is loaded from a yaml. I'm
unsure of how to to load a different yaml-conf for the purpose of
testing alternate configurations, or of how to best manipulate the
configuration of my app after the load to simulate a test in a
different environments then the default.

http://github.com/EvanCarroll/Craiglickr/blob/master/craiglickr.yaml

Craiglickr:
  location:
    cross_posting: 1
    cross_metro: 0
    max: 4
  category:
    cross_posting: 0


I want to test different settings such as if cross_metro was set to 1,
or of cross_posting was set to 0, and such.

--
Evan Carroll
System Lord of the Internets
http://www.evancarroll.com

_______________________________________________
List: Catalyst@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/

Re: Catalyst::Test configuration questions

by Jason Galea :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Tue, Oct 27, 2009 at 8:17 AM, Evan Carroll <lists@...> wrote:
I want to dynamically modify the configuration of my application for
the purpose of testing. That configuration is loaded from a yaml. I'm
unsure of how to to load a different yaml-conf for the purpose of
testing alternate configurations, or of how to best manipulate the
configuration of my app after the load to simulate a test in a
different environments then the default.


http://search.cpan.org/~bricas/Catalyst-Plugin-ConfigLoader-0.27/lib/Catalyst/Plugin/ConfigLoader.pm

get_config_local_suffix

Determines the suffix of files used to override the main config. By default this value is local, which will load myapp_local.conf. The suffix can be specified in the following order of preference:

  • $ENV{ MYAPP_CONFIG_LOCAL_SUFFIX }
  • $ENV{ CATALYST_CONFIG_LOCAL_SUFFIX }
  • $c->config->{ 'Plugin::ConfigLoader' }->{ config_local_suffix }

The first one of these values found replaces the default of local in the name of the local config file to be loaded.

For example, if $ENV{ MYAPP_CONFIG_LOCAL_SUFFIX } is set to testing, ConfigLoader will try and load myapp_testing.conf instead of myapp_local.conf.

cheers,

J


--
Jason Galea
Web Developer

Ph 07 40556926
Mob 04 12345 534
www.eightdegrees.com.au


_______________________________________________
List: Catalyst@...
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@.../
Dev site: http://dev.catalyst.perl.org/