# encoding: utf-8

$:.unshift File.expand_path('../../lib', __FILE__)
require 'transformer'
require 'minitest/spec'
require 'minitest/autorun'

def rand_str(length=7)
  (0...length).map{65.+(rand(25)).chr}.join.downcase
end

class String
  def underscore
    self.gsub(/::/, '/').
    gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
    gsub(/([a-z\d])([A-Z])/,'\1_\2').
    tr("-", "_").
    downcase
  end
end