[Jifty-commit] r4046 - in Jifty-DBI/trunk: t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Thu Sep 6 14:30:45 EDT 2007
Author: jesse
Date: Thu Sep 6 14:30:44 2007
New Revision: 4046
Modified:
Jifty-DBI/trunk/ (props changed)
Jifty-DBI/trunk/t/01records.t
Jifty-DBI/trunk/t/02records_cachable.t
Jifty-DBI/trunk/t/02records_object.t
Jifty-DBI/trunk/t/11schema_records.t
Jifty-DBI/trunk/t/12prefetch.t
Log:
r67015 at pinglin: jesse | 2007-09-06 14:29:24 -0400
* Fixing case errors in tests
Modified: Jifty-DBI/trunk/t/01records.t
==============================================================================
--- Jifty-DBI/trunk/t/01records.t (original)
+++ Jifty-DBI/trunk/t/01records.t Thu Sep 6 14:30:44 2007
@@ -74,10 +74,10 @@
is($rec->id, $id, "The record has its id");
is ($rec->name, 'Jesse', "The record's name is Jesse");
+ warn YAML::Dump($rec); use YAML;
my ($val, $msg) = $rec->set_name('Obra');
ok($val, $msg) ;
is($rec->name, 'Obra', "We did actually change the name");
-
# Validate immutability of the column id
($val, $msg) = $rec->set_id( $rec->id + 1 );
ok(!$val, $msg);
@@ -140,7 +140,6 @@
($val, $msg) = $newrec->_load_from_sql('SELECT id FROM addresses WHERE id = ?', 0);
is($val, 0, "didn't find object");
is($msg, "Couldn't find row", "reason is wrong id");
-
# _load_from_sql and wrong SQL
$newrec = TestApp::Address->new( handle => $handle );
{
Modified: Jifty-DBI/trunk/t/02records_cachable.t
==============================================================================
--- Jifty-DBI/trunk/t/02records_cachable.t (original)
+++ Jifty-DBI/trunk/t/02records_cachable.t Thu Sep 6 14:30:44 2007
@@ -34,7 +34,7 @@
isa_ok( $rec, 'Jifty::DBI::Record' );
my ($id)
- = $rec->create( Name => 'Jesse', Phone => '617 124 567' );
+ = $rec->create( name => 'Jesse', phone => '617 124 567' );
ok( $id, "Created record #$id" );
ok( $rec->load($id), "Loaded the record" );
@@ -52,7 +52,7 @@
{ # load by name then load by id, check that we fetch from hash
my $rec = TestApp::Address->new( handle => $handle );
- ok( $rec->load_by_cols( Name => 'Jesse' ), "Loaded the record" );
+ ok( $rec->load_by_cols( name => 'Jesse' ), "Loaded the record" );
is( $rec->name, 'Jesse', "The record's name is Jesse" );
my $rec_cache = TestApp::Address->new( handle => $handle );
@@ -66,44 +66,44 @@
{ # load_by_cols and undef, 0 or '' values
my $rec = TestApp::Address->new( handle => $handle );
- my ($id) = $rec->create( Name => 'EmptyPhone', Phone => '' );
+ my ($id) = $rec->create( name => 'Emptyphone', phone => '' );
ok( $id, "Created record #$id" );
- ($id) = $rec->create( Name => 'ZeroPhone', Phone => 0 );
+ ($id) = $rec->create( name => 'Zerophone', phone => 0 );
ok( $id, "Created record #$id" );
- ($id) = $rec->create( Name => 'UndefPhone', Phone => undef );
+ ($id) = $rec->create( name => 'Undefphone', phone => undef );
ok( $id, "Created record #$id" );
Jifty::DBI::Record::Cachable->flush_cache;
- ok( $rec->load_by_cols( Phone => undef ), "Loaded the record" );
- is( $rec->name, 'UndefPhone', "UndefPhone record" );
+ ok( $rec->load_by_cols( phone => undef ), "Loaded the record" );
+ is( $rec->name, 'Undefphone', "Undefphone record" );
- is( $rec->phone, undef, "Phone number is undefined" );
+ is( $rec->phone, undef, "phone number is undefined" );
- ok( $rec->load_by_cols( Phone => '' ), "Loaded the record" );
- is( $rec->name, 'EmptyPhone', "EmptyPhone record" );
- is( $rec->phone, '', "Phone number is empty string" );
-
- ok( $rec->load_by_cols( Phone => 0 ), "Loaded the record" );
- is( $rec->name, 'ZeroPhone', "ZeroPhone record" );
- is( $rec->phone, 0, "Phone number is zero" );
+ ok( $rec->load_by_cols( phone => '' ), "Loaded the record" );
+ is( $rec->name, 'Emptyphone', "Emptyphone record" );
+ is( $rec->phone, '', "phone number is empty string" );
+
+ ok( $rec->load_by_cols( phone => 0 ), "Loaded the record" );
+ is( $rec->name, 'Zerophone', "Zerophone record" );
+ is( $rec->phone, 0, "phone number is zero" );
# XXX: next thing fails, looks like operator is mandatory
- # ok($rec->load_by_cols( Phone => { value => 0 } ), "Loaded the record");
+ # ok($rec->load_by_cols( phone => { value => 0 } ), "Loaded the record");
ok( $rec->load_by_cols(
- Phone => { operator => '=', value => 0 }
+ phone => { operator => '=', value => 0 }
),
"Loaded the record"
);
- is( $rec->name, 'ZeroPhone', "ZeroPhone record" );
- is( $rec->phone, 0, "Phone number is zero" );
+ is( $rec->name, 'Zerophone', "Zerophone record" );
+ is( $rec->phone, 0, "phone number is zero" );
}
Jifty::DBI::Record::Cachable->flush_cache;
{ # case insensetive columns names
my $rec = TestApp::Address->new( handle => $handle );
- ok( $rec->load_by_cols( Name => 'Jesse' ), "Loaded the record" );
+ ok( $rec->load_by_cols( name => 'Jesse' ), "Loaded the record" );
is( $rec->name, 'Jesse', "loaded record" );
my $rec_cache = TestApp::Address->new( handle => $handle );
Modified: Jifty-DBI/trunk/t/02records_object.t
==============================================================================
--- Jifty-DBI/trunk/t/02records_object.t (original)
+++ Jifty-DBI/trunk/t/02records_object.t Thu Sep 6 14:30:44 2007
@@ -31,7 +31,7 @@
isa_ok($ret,'DBI::st', "Inserted the schema. got a statement handle back" );}
my $emp = TestApp::Employee->new( handle => $handle );
- my $e_id = $emp->create( Name => 'RUZ' );
+ my $e_id = $emp->create( name => 'RUZ' );
ok($e_id, "Got an id for the new emplyee");
my $phone = TestApp::Phone->new( handle => $handle );
isa_ok( $phone, 'TestApp::Phone', "it's a TestApp::Phone");
@@ -106,7 +106,7 @@
"CREATE SEQUENCE employees_seq",
"CREATE TABLE employees (
id integer CONSTRAINT employees_key PRIMARY KEY,
- Name varchar(36)
+ name varchar(36)
)",
"CREATE SEQUENCE phones_seq",
"CREATE TABLE phones (
Modified: Jifty-DBI/trunk/t/11schema_records.t
==============================================================================
--- Jifty-DBI/trunk/t/11schema_records.t (original)
+++ Jifty-DBI/trunk/t/11schema_records.t Thu Sep 6 14:30:44 2007
@@ -31,7 +31,7 @@
isa_ok($ret,'DBI::st', "Inserted the schema. got a statement handle back" );}
my $emp = TestApp::Employee->new( handle => $handle );
- my $e_id = $emp->create( Name => 'RUZ' );
+ my $e_id = $emp->create( name => 'RUZ' );
ok($e_id, "Got an id for the new employee: $e_id");
$emp->load($e_id);
is($emp->id, $e_id);
Modified: Jifty-DBI/trunk/t/12prefetch.t
==============================================================================
--- Jifty-DBI/trunk/t/12prefetch.t (original)
+++ Jifty-DBI/trunk/t/12prefetch.t Thu Sep 6 14:30:44 2007
@@ -32,7 +32,7 @@
my $emp = TestApp::Employee->new( handle => $handle );
- my $e_id = $emp->create( Name => 'RUZ' );
+ my $e_id = $emp->create( name => 'RUZ' );
ok($e_id, "Got an id for the new employee: $e_id");
$emp->load($e_id);
is($emp->id, $e_id);
@@ -55,7 +55,7 @@
}
my $emp2 = TestApp::Employee->new( handle => $handle );
- my $e2_id = $emp2->create( Name => 'JESSE' );
+ my $e2_id = $emp2->create( name => 'JESSE' );
my $phone2 = TestApp::Phone->new( handle => $handle );
my $p2_id = $phone2->create( employee => $e2_id, phone => '+16173185823');
More information about the Jifty-commit
mailing list