Sha256: 208f491180880b560ee20ba8b4589c1a3a326bb8bb78d0b6015e954e87c2e6d8
Contents?: true
Size: 1.78 KB
Versions: 9
Compression:
Stored size: 1.78 KB
Contents
require File.dirname(__FILE__)+'/../spec_helper' require File.dirname(__FILE__)+'/inflector_test_cases' require 'gorillib/string/inflections' include InflectorTestCases describe String do describe 'camelize' do CamelToUnderscore.each do |cameled, underscored| it underscored do underscored.camelize.should == cameled end end it 'with lower, downcases the first letter' do 'Capital'.camelize(:lower).should == 'capital' end UnderscoreToLowerCamel.each do |underscored, lower_cameled| it lower_cameled do underscored.camelize(:lower).should == lower_cameled end end CamelWithModuleToUnderscoreWithSlash.each do |cameled, underscored| it underscored do underscored.camelize.should == cameled end end end describe '#snakeize' do UnderscoreToLowerCamel.each do |underscored, snaked| it underscored do underscored.snakeize.should == snaked end end end describe '#underscore' do CamelToUnderscore.each do |cameled, underscored| it cameled do cameled.underscore.should == underscored end end CamelToUnderscoreWithoutReverse.each do |cameled, underscored| it underscored do cameled.underscore.should == underscored end end CamelWithModuleToUnderscoreWithSlash.each do |cameled, underscored| it underscored do cameled.underscore.should == underscored end end it "HTMLTidy" do "HTMLTidy".underscore.should == "html_tidy" end it "HTMLTidyGenerator" do "HTMLTidyGenerator".underscore.should == "html_tidy_generator" end end describe '#demodulize' do it 'strips module part' do "MyApplication::Billing::Account".demodulize.should == "Account" end end end
Version data entries
9 entries across 9 versions & 1 rubygems