In Facets I offer:

  class String
    def to_ary
      self.split(//)
    end
  end

This proves useful in adding other methods to Enumerable that can act
to all enumerables and on strings as character arrays. For instance:

  # Generates a hash mapping each unique element to the frequency it
appears.
  #--
  # Credit goes to Derek.
  #++
  def freq
    arr = respond_to?(:to_ary) ? self.to_ary : self.to_a
    probHash = Hash.new
    size = arr.size.to_f
    arr.uniq.each do |i|
      ct = arr.inject(0) do |mem,obj|
        obj.eql?(i) ? (mem+1) : mem
      end
      probHash[i] = ct.to_f/size
    end
    probHash
  end

I had hopped by using Sting#to_ary I would avoid any problems b/c it is
not defined by default. Alas I don't seem so fortunate. Test::Unit
chokes on it:

  irb(main):001:0> require 'facet/string/to_ary'
  => true
  irb(main):002:0> require 'test/unit'
  => true
  irb(main):003:0> class TC < Test::Unit::TestCase
  irb(main):004:1>   def test01
  irb(main):005:2>     assert_equal( ['a','b','c'], 'abc'.to_ary )
  irb(main):006:2>   end
  irb(main):007:1> end
  => nil
  irb(main):008:0> require 'test/unit/ui/console/testrunner'
  => true
  irb(main):009:0> Test::Unit::UI::Console::TestRunner.run(TC)
  SystemStackError: stack level too deep
          from
/usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:105:in `puts'
          from
/usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:105:in `output'
          from
/usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:49:in
`setup_mediator'
          from
/usr/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:37:in `start'
          from
/usr/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:27:in `run'
          from (irb):10

Why is this and what can be done about it?

Thanks,
T.