<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>README</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -6,3 +6,4 @@ Makefile
 pkg
 doc
 .DS_Store
+*.log
\ No newline at end of file</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -5,11 +5,36 @@ static VALUE gunichars_size(VALUE self, VALUE string)
 {
   VALUE result;
 
+  Check_Type(string, T_STRING);
   result = ULONG2NUM(g_utf8_strlen(StringValuePtr(string), RSTRING(string)-&gt;len));
 
   return result;
 }
 
+static VALUE gunichars_upcase(VALUE self, VALUE string)
+{
+  VALUE result;
+  gchar *temp;
+
+  Check_Type(string, T_STRING);
+  temp = g_utf8_strup(StringValuePtr(string), RSTRING(string)-&gt;len);
+  result = rb_str_new2(temp);
+
+  return result;
+}
+
+static VALUE gunichars_downcase(VALUE self, VALUE string)
+{
+  VALUE result;
+  gchar *temp;
+
+  Check_Type(string, T_STRING);
+  temp = g_utf8_strdown(StringValuePtr(string), RSTRING(string)-&gt;len);
+  result = rb_str_new2(temp);
+
+  return result;
+}
+
 void
 Init_gunichars()
 {
@@ -17,4 +42,6 @@ Init_gunichars()
 
   mGunichars = rb_define_module(&quot;Gunichars&quot;);
   rb_define_method(mGunichars, &quot;size&quot;, gunichars_size, 1);
+  rb_define_method(mGunichars, &quot;upcase&quot;, gunichars_upcase, 1);
+  rb_define_method(mGunichars, &quot;downcase&quot;, gunichars_downcase, 1);
 }</diff>
      <filename>ext/gunichars/gunichars.c</filename>
    </modified>
    <modified>
      <diff>@@ -10,4 +10,12 @@ class Unichars
   def size
     self.class.size(@wrapped_string)
   end
+  
+  def upcase
+    self.class.upcase(@wrapped_string)
+  end
+  
+  def downcase
+    self.class.downcase(@wrapped_string)
+  end
 end
\ No newline at end of file</diff>
      <filename>lib/unichars.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,5 +7,5 @@ describe &quot;Gunichars&quot; do
     lambda {
       Gunichars
     }.should.not.raise
-  end  
+  end
 end
\ No newline at end of file</diff>
      <filename>test/gunichars_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,11 +3,30 @@ require File.dirname(__FILE__) + '/test_helper'
 require 'unichars'
 
 describe &quot;A Unichars instance&quot; do
-  before do
-    @chars = Unichars.new('Profit&#233;r&#248;l')
+  it &quot;should know it's size&quot; do
+    chars('').size.should == 0
+    chars('Profit&#233;r&#248;l').size.should == 10
   end
   
-  it &quot;should know it's size&quot; do
-    @chars.size.should == 10
-  end  
+  it &quot;should upcase strings&quot; do
+    chars('').upcase.should == ''
+    chars('Profit&#233;r&#248;l').upcase.should == 'PROFIT&#201;R&#216;L'
+  end
+  
+  it &quot;should downcase strings&quot; do
+    chars('').downcase.should == ''
+    chars('PROFIT&#201;R&#216;L').downcase.should == 'profit&#233;r&#248;l'
+  end
+  
+  it &quot;should raise a TypeError when anything except a string is passed&quot; do
+    lambda { chars(nil).size }.should.raise(TypeError)
+    lambda { chars(nil).upcase }.should.raise(TypeError)
+    lambda { chars(nil).downcase }.should.raise(TypeError)
+  end
+  
+  protected
+  
+  def chars(string)
+    Unichars.new(string)
+  end
 end
\ No newline at end of file</diff>
      <filename>test/unichars_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dab86e81bc8a7676bc44d3341c59cc74d2c564dc</id>
    </parent>
  </parents>
  <author>
    <name>Manfred Stienstra</name>
    <email>manfred@fngtps.com</email>
  </author>
  <url>http://github.com/Manfred/unichars/commit/39e110f60511dd11ef36fecc69d7525a737f07af</url>
  <id>39e110f60511dd11ef36fecc69d7525a737f07af</id>
  <committed-date>2008-06-17T12:48:49-07:00</committed-date>
  <authored-date>2008-06-17T12:48:49-07:00</authored-date>
  <message>Add upcase and downcase method.</message>
  <tree>91cf5257e2e4c6c2da7a1c6a20605e15a9662ed7</tree>
  <committer>
    <name>Manfred Stienstra</name>
    <email>manfred@fngtps.com</email>
  </committer>
</commit>
