X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_controller_config.t;h=397882c97fb23e80a4346fb83cf7a0365068c2bc;hb=aa2e6d9e59b1373b13fe7c37725f3fab3b8a1e92;hp=1a6bd7829a03a700ccd1e19c2c839a4318d766b5;hpb=c7ded7aaf69e506924a5406349fd665c7717acb8;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_controller_config.t b/t/unit_controller_config.t index 1a6bd78..397882c 100755 --- a/t/unit_controller_config.t +++ b/t/unit_controller_config.t @@ -34,17 +34,17 @@ use_ok('Catalyst'); package controller_a; use base 'base_controller'; - + __PACKAGE__->config( key_a => 'value_a' ); } - - + + { package controller_b; use base 'base_controller'; - __PACKAGE__->config( key_b => 'value_b' ); + __PACKAGE__->config->{key_b} = 'value_b'; } ## Okay, we expect that the base controller has a config with one key @@ -55,26 +55,26 @@ use_ok('Catalyst'); ## ---------------------------------------------------------------------------- ## THE TESTS. Basically we first check to make sure that all the children of ## the base_controller properly inherit the {base_key => 'base_value'} info -## and that each of the children also has it's local config data and that none +## and that each of the children also has its local config data and that none ## of the classes have data that is unexpected. ## ---------------------------------------------------------------------------- # First round, does everything have what we expect to find? If these tests fail there is something -# wrong with the way config is storing it's information. +# wrong with the way config is storing its information. ok( base_controller->config->{base_key} eq 'base_value', 'base_controller has expected config value for "base_key"') or diag('"base_key" defined as "'.base_controller->config->{base_key}.'" and not "base_value" in config'); ok( controller_a->config->{base_key} eq 'base_value', 'controller_a has expected config value for "base_key"') or diag('"base_key" defined as "'.controller_a->config->{base_key}.'" and not "base_value" in config'); - + ok( controller_a->config->{key_a} eq 'value_a', 'controller_a has expected config value for "key_a"') or diag('"key_a" defined as "'.controller_a->config->{key_a}.'" and not "value_a" in config'); ok( controller_b->config->{base_key} eq 'base_value', 'controller_b has expected config value for "base_key"') or diag('"base_key" defined as "'.controller_b->config->{base_key}.'" and not "base_value" in config'); - + ok( controller_b->config->{key_b} eq 'value_b', 'controller_b has expected config value for "key_b"') or diag('"key_b" defined as "'.controller_b->config->{key_b}.'" and not "value_b" in config'); @@ -83,9 +83,9 @@ ok( controller_b->config->{key_b} eq 'value_b', 'controller_b has expected confi ok( scalar(keys %{base_controller->config}) == 1, 'base_controller has the expected number of config values') or diag("base_controller should have 1 config value, but it has ".scalar(keys %{base_controller->config})); - + ok( scalar(keys %{controller_a->config}) == 2, 'controller_a has the expected number of config values') or diag("controller_a should have 2 config value, but it has ".scalar(keys %{base_controller->config})); - + ok( scalar(keys %{controller_b->config}) == 2, 'controller_b has the expected number of config values') or diag("controller_a should have 2 config value, but it has ".scalar(keys %{base_controller->config}));