Author: jkeenan
Date: Fri Nov 23 05:03:39 2007
New Revision: 22978

Modified:
   branches/nointer/t/configure/061-initialize.t
   branches/nointer/t/configure/062-initialize.t
   branches/nointer/t/configure/063-initialize.t
   branches/nointer/t/configure/064-initialize.t

Log:
Convert tests to using P::C::Initialize methods set(), add() and get().


Modified: branches/nointer/t/configure/061-initialize.t
==============================================================================
--- branches/nointer/t/configure/061-initialize.t       (original)
+++ branches/nointer/t/configure/061-initialize.t       Fri Nov 23 05:03:39 2007
@@ -6,7 +6,7 @@
 use strict;
 use warnings;
 
-use Test::More qw(no_plan); # tests =>  7;
+use Test::More tests =>  6;
 use Carp;
 use lib qw( lib t/configure/testlib );
 use Parrot::Configure;
@@ -25,10 +25,9 @@
 isa_ok($init, "Parrot::Configure::Initialize");
 ok($init->init_defaults(), 'init_defaults() completed okay');
 
-# Next 3 tests cheat by breaking encapsulation.
+# Next 2 tests cheat by breaking encapsulation.
 is($init->get('debugging'), 0, "Got expected value for 'debugging'");
 is($init->get('cc_debug'), q{ -pg }, "Got expected value for 'cc_debug'");
-#is($init->{options}->{m}, 32, "Got expected value for 'm'");
 
 pass("Completed all tests in $0");
 

Modified: branches/nointer/t/configure/062-initialize.t
==============================================================================
--- branches/nointer/t/configure/062-initialize.t       (original)
+++ branches/nointer/t/configure/062-initialize.t       Fri Nov 23 05:03:39 2007
@@ -38,21 +38,21 @@
     isa_ok($init, "Parrot::Configure::Initialize");
     ok($init->init_install(), 'init_install() completed okay');
 
-    is( $init->{prefix},         $tdir,  "--prefix option confirmed" );
-    is( $init->{exec_prefix},    $tdir,  "--exec-prefix option confirmed" );
-    is( $init->{bindir},         $tdir1, "--bindir option confirmed" );
-    is( $init->{sbindir},        $tdir1, "--sbindir option confirmed" );
-    is( $init->{libexecdir},     $tdir1, "--libexecdir option confirmed" );
-    is( $init->{datadir},        $tdir1, "--datadir option confirmed" );
-    is( $init->{doc_dir},        qq{$tdir1/doc/parrot}, "--datadir option 
confirmed" );
-    is( $init->{sysconfdir},     $tdir1, "--syscondir option confirmed" );
-    is( $init->{sharedstatedir}, $tdir1, "--sharedstatedir option confirmed" );
-    is( $init->{localstatedir},  $tdir1, "--localstatedir option confirmed" );
-    is( $init->{libdir},         $tdir1, "--libdir option confirmed" );
-    is( $init->{includedir},     $tdir1, "--includedir option confirmed" );
-    is( $init->{oldincludedir},  $tdir1, "--oldincludedir option confirmed" );
-    is( $init->{infodir},        $tdir1, "--infodir option confirmed" );
-    is( $init->{mandir},         $tdir1, "--mandir option confirmed" );
+    is( $init->get('prefix'),         $tdir,  "--prefix option confirmed" );
+    is( $init->get('exec_prefix'),    $tdir,  "--exec-prefix option confirmed" 
);
+    is( $init->get('bindir'),         $tdir1, "--bindir option confirmed" );
+    is( $init->get('sbindir'),        $tdir1, "--sbindir option confirmed" );
+    is( $init->get('libexecdir'),     $tdir1, "--libexecdir option confirmed" 
);
+    is( $init->get('datadir'),        $tdir1, "--datadir option confirmed" );
+    is( $init->get('doc_dir'),        qq{$tdir1/doc/parrot}, "--datadir option 
confirmed" );
+    is( $init->get('sysconfdir'),     $tdir1, "--syscondir option confirmed" );
+    is( $init->get('sharedstatedir'), $tdir1, "--sharedstatedir option 
confirmed" );
+    is( $init->get('localstatedir'),  $tdir1, "--localstatedir option 
confirmed" );
+    is( $init->get('libdir'),         $tdir1, "--libdir option confirmed" );
+    is( $init->get('includedir'),     $tdir1, "--includedir option confirmed" 
);
+    is( $init->get('oldincludedir'),  $tdir1, "--oldincludedir option 
confirmed" );
+    is( $init->get('infodir'),        $tdir1, "--infodir option confirmed" );
+    is( $init->get('mandir'),         $tdir1, "--mandir option confirmed" );
 }
 
 pass("Completed all tests in $0");

Modified: branches/nointer/t/configure/063-initialize.t
==============================================================================
--- branches/nointer/t/configure/063-initialize.t       (original)
+++ branches/nointer/t/configure/063-initialize.t       Fri Nov 23 05:03:39 2007
@@ -40,23 +40,23 @@
     isa_ok($init, "Parrot::Configure::Initialize");
     ok($init->init_install(), 'init_install() completed okay');
 
-    is( $init->{prefix},
+    is( $init->get('prefix'),
         $tdir_orig, "--prefix option confirmed; trailing slash stripped" );
-    is( $init->{exec_prefix},
+    is( $init->get('exec_prefix'),
         $tdir_orig, "--exec-prefix option confirmed; trailing slash stripped" 
);
-    is( $init->{bindir},         $tdir1, "--bindir option confirmed" );
-    is( $init->{sbindir},        $tdir1, "--sbindir option confirmed" );
-    is( $init->{libexecdir},     $tdir1, "--libexecdir option confirmed" );
-    is( $init->{datadir},        $tdir1, "--datadir option confirmed" );
-    is( $init->{doc_dir},        qq{$tdir1/doc/parrot}, "--datadir option 
confirmed" );
-    is( $init->{sysconfdir},     $tdir1, "--syscondir option confirmed" );
-    is( $init->{sharedstatedir}, $tdir1, "--sharedstatedir option confirmed" );
-    is( $init->{localstatedir},  $tdir1, "--localstatedir option confirmed" );
-    is( $init->{libdir},         $tdir1, "--libdir option confirmed" );
-    is( $init->{includedir},     $tdir1, "--includedir option confirmed" );
-    is( $init->{oldincludedir},  $tdir1, "--oldincludedir option confirmed" );
-    is( $init->{infodir},        $tdir1, "--infodir option confirmed" );
-    is( $init->{mandir},         $tdir1, "--mandir option confirmed" );
+    is( $init->get('bindir'),         $tdir1, "--bindir option confirmed" );
+    is( $init->get('sbindir'),        $tdir1, "--sbindir option confirmed" );
+    is( $init->get('libexecdir'),     $tdir1, "--libexecdir option confirmed" 
);
+    is( $init->get('datadir'),        $tdir1, "--datadir option confirmed" );
+    is( $init->get('doc_dir'),        qq{$tdir1/doc/parrot}, "--datadir option 
confirmed" );
+    is( $init->get('sysconfdir'),     $tdir1, "--syscondir option confirmed" );
+    is( $init->get('sharedstatedir'), $tdir1, "--sharedstatedir option 
confirmed" );
+    is( $init->get('localstatedir'),  $tdir1, "--localstatedir option 
confirmed" );
+    is( $init->get('libdir'),         $tdir1, "--libdir option confirmed" );
+    is( $init->get('includedir'),     $tdir1, "--includedir option confirmed" 
);
+    is( $init->get('oldincludedir'),  $tdir1, "--oldincludedir option 
confirmed" );
+    is( $init->get('infodir'),        $tdir1, "--infodir option confirmed" );
+    is( $init->get('mandir'),         $tdir1, "--mandir option confirmed" );
 }
 
 pass("Completed all tests in $0");

Modified: branches/nointer/t/configure/064-initialize.t
==============================================================================
--- branches/nointer/t/configure/064-initialize.t       (original)
+++ branches/nointer/t/configure/064-initialize.t       Fri Nov 23 05:03:39 2007
@@ -27,35 +27,35 @@
 isa_ok($init, "Parrot::Configure::Initialize");
 ok($init->init_install(), 'init_install() completed okay');
 
-is( $init->{prefix},         qq{/usr/local},
+is( $init->get('prefix'),         qq{/usr/local},
     "--prefix option confirmed" );
-is( $init->{exec_prefix},    qq{/usr/local},
+is( $init->get('exec_prefix'),    qq{/usr/local},
     "--exec-prefix option confirmed" );
-is( $init->{bindir},         qq{/usr/local/bin},
+is( $init->get('bindir'),         qq{/usr/local/bin},
     "--bindir option confirmed" );
-is( $init->{sbindir},        qq{/usr/local/sbin},
+is( $init->get('sbindir'),        qq{/usr/local/sbin},
     "--sbindir option confirmed" );
-is( $init->{libexecdir},     qq{/usr/local/libexec},
+is( $init->get('libexecdir'),     qq{/usr/local/libexec},
     "--libexecdir option confirmed" );
-is( $init->{datadir},        qq{/usr/local/share},
+is( $init->get('datadir'),        qq{/usr/local/share},
     "--datadir option confirmed" );
-is( $init->{doc_dir},        qq{/usr/local/share/doc/parrot},
+is( $init->get('doc_dir'),        qq{/usr/local/share/doc/parrot},
     "--doc_dir option confirmed" );
-is( $init->{sysconfdir},     qq{/usr/local/etc},
+is( $init->get('sysconfdir'),     qq{/usr/local/etc},
     "--sysconfdir option confirmed" );
-is( $init->{sharedstatedir}, qq{/usr/local/com},
+is( $init->get('sharedstatedir'), qq{/usr/local/com},
     "--sharedstatedir option confirmed" );
-is( $init->{localstatedir},  qq{/usr/local/var},
+is( $init->get('localstatedir'),  qq{/usr/local/var},
     "--localstatedir option confirmed" );
-is( $init->{libdir},         qq{/usr/local/lib},
+is( $init->get('libdir'),         qq{/usr/local/lib},
     "--libdir option confirmed" );
-is( $init->{includedir},     qq{/usr/local/include},
+is( $init->get('includedir'),     qq{/usr/local/include},
     "--includedir option confirmed" );
-is( $init->{oldincludedir},  qq{/usr/include},
+is( $init->get('oldincludedir'),  qq{/usr/include},
     "--oldincludedir option confirmed" );
-is( $init->{infodir},        qq{/usr/local/info},
+is( $init->get('infodir'),        qq{/usr/local/info},
     "--infodir option confirmed" );
-is( $init->{mandir},         qq{/usr/local/man},
+is( $init->get('mandir'),         qq{/usr/local/man},
     "--mandir option confirmed" );
 
 pass("Completed all tests in $0");

Reply via email to