Sha256: 67017866b8e82f94388c66200459e26b30ee88bdbac83042b8990446e72f95d3
Contents?: true
Size: 1.81 KB
Versions: 3
Compression:
Stored size: 1.81 KB
Contents
require File.expand_path('../spec_helper', File.dirname(__FILE__)) require File.expand_path('inflector_test_cases', File.dirname(__FILE__)) 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
gorillib-0.1.11 | spec/string/inflections_spec.rb |
gorillib-0.1.9 | spec/string/inflections_spec.rb |
gorillib-0.1.8 | spec/string/inflections_spec.rb |