Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #1793 (closed defect: duplicate)

Opened 5 years ago

Last modified 4 years ago

[PATCH] Fix OCI camelCase and base_test unit tests

Reported by: mschoen Assigned to: David
Priority: normal Milestone: 1.0
Component: ActiveRecord Version: 0.13.1
Severity: normal Keywords: oci, camelcase
Cc:

Description

This patch fixes the 2 unit test failures (oci_test) below.

The first was the result of incomplete handling of camelCase column names in Oracle. Since camelCase column names are kind of a no-no in Oracle anyway, I was tempted to "fix" the failure by changing the tests to just skip this test when testing Oracle. But it turned out the fix wasn't too bad, and taught me something about Rails. BTW, this "bug" was introduced by Ticket #533. Have the tests been failing since then?

The second was the result of how the OCIAdapter makes assumptions about whether a column is a Date or a Time. Since that isn't what this specific test is about (it was checking the protection of attributes in mass assignment), I cheated -- I fixed it by changing the actual time used so that it included a non-zero hour, which makes it work.

In working on my patches to the oci adapter, I find that the trunk currently fails the base_test suite... $ ruby -I connections/native_oci/ base_test.rb Using OCI Oracle Loaded suite base_test Started ...F.....................................................F.............................. Finished in 19.711216 seconds. 1) Failure: test_attributes_hash(BasicsTest) [base_test.rb:117]: <{"extendedWarranty"=>1, "id"=>1, "developer"=>1}> expected but was <{"id"=>1, "extendedwarranty"=>1, "developer"=>1}>. 2) Failure: test_multiparameter_mass_assignment_protector(BasicsTest) [base_test.rb:578]: <Sat Jan 01 00:00:00 PST 2000> expected but was <#<Date: 4903089/2,0,2299161>>. 88 tests, 197 assertions, 2 failures, 0 errors

Attachments

oci_camelcase_unittests.patch (4.5 kB) - added by mschoen on 07/21/05 04:42:31.
Patch file (from svn diff)

Change History

07/21/05 04:42:31 changed by mschoen

  • attachment oci_camelcase_unittests.patch added.

Patch file (from svn diff)

07/21/05 18:06:04 changed by mschoen

  • status changed from new to closed.
  • resolution set to duplicate.

Obsolete, see Ticket #1798