Sha256: c6d0c53c959cc54757715c60d6d70e6f2c5797e4446a677ad203a3961d04f7ae
Contents?: true
Size: 869 Bytes
Versions: 19
Compression:
Stored size: 869 Bytes
Contents
require "spec_helper" describe String do describe "#snakecase" do it "lowercases one word CamelCase" do "Merb".snakecase.should == "merb" end it "makes one underscore snakecase two word CamelCase" do "MerbCore".snakecase.should == "merb_core" end it "handles CamelCase with more than 2 words" do "SoYouWantContributeToMerbCore".snakecase.should == "so_you_want_contribute_to_merb_core" end it "handles CamelCase with more than 2 capital letter in a row" do "CNN".snakecase.should == "cnn" "CNNNews".snakecase.should == "cnn_news" "HeadlineCNNNews".snakecase.should == "headline_cnn_news" end it "does NOT change one word lowercase" do "merb".snakecase.should == "merb" end it "leaves snake_case as is" do "merb_core".snakecase.should == "merb_core" end end end
Version data entries
19 entries across 19 versions & 4 rubygems