zhangjingl02 / activejdbc

Automatically exported from code.google.com/p/activejdbc
0 stars 0 forks source link

capitalize method in invokeBoolean in Expectation.java does not handle camel case method names. #162

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From Evan:

if I try to do this test

a(obj).shouldBe("AsTallAsLions"); 

It will fail to find the matching method. It will erroneously try to call 
"isAstallaslions" and "hasAsTallAsLions". The issue is that it is lowercasing 
the later part of the string in the capitalize method in Expectation.java

Please apply this small patch:

Index: javalite-common/src/main/java/org/javalite/test/jspec/Expectation.java
===================================================================
--- 
javalite-common/src/main/java/org/javalite/test/jspec/Expectation.java  (revision
 776)
+++ 
javalite-common/src/main/java/org/javalite/test/jspec/Expectation.java  (working 
copy)
@@ -290,7 +290,7 @@

     private String capitalize(String s) {
         if (s.length() == 0) return s;
-        return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
+        return s.substring(0, 1).toUpperCase() + s.substring(1);
     }

     /**

This was erroneously entered into ActiveWeb tracker:
http://code.google.com/p/activeweb/issues/detail?id=105

Original issue reported on code.google.com by ipolevoy@gmail.com on 29 May 2012 at 10:39

GoogleCodeExporter commented 9 years ago

Original comment by ipolevoy@gmail.com on 29 May 2012 at 10:42

GoogleCodeExporter commented 9 years ago
Thank you :)

Original comment by evan.leo...@gmail.com on 29 May 2012 at 11:24