Sha256: f91909231327301a818a31cd63596e701ec2abba19bdf2bde2604b8ebd57ef18

Contents?: true

Size: 794 Bytes

Versions: 24

Compression:

Stored size: 794 Bytes

Contents

describe String, "#snake_case" do
  it "lowercases one word CamelCase" do
    "Merb".snake_case.should == "merb"
  end

  it "makes one underscore snake_case two word CamelCase" do
    "MerbCore".snake_case.should == "merb_core"
  end

  it "handles CamelCase with more than 2 words" do
    "SoYouWantContributeToMerbCore".snake_case.should == "so_you_want_contribute_to_merb_core"
  end

  it "handles CamelCase with more than 2 capital letter in a row" do
    "CNN".snake_case.should == "cnn"
    "CNNNews".snake_case.should == "cnn_news"
    "HeadlineCNNNews".snake_case.should == "headline_cnn_news"
  end

  it "does NOT change one word lowercase" do
    "merb".snake_case.should == "merb"
  end

  it "leaves snake_case as is" do
    "merb_core".snake_case.should == "merb_core"
  end
end

Version data entries

24 entries across 24 versions & 9 rubygems

Version Path
alexvollmer-httparty-0.3.1 spec/string_spec.rb
alexvollmer-httparty-0.4.3 spec/string_spec.rb
cluon-httparty-0.4.3 spec/string_spec.rb
jnunemaker-httparty-0.3.0 spec/string_spec.rb
jnunemaker-httparty-0.3.1 spec/string_spec.rb
jnunemaker-httparty-0.4.0 spec/string_spec.rb
jnunemaker-httparty-0.4.1 spec/string_spec.rb
jnunemaker-httparty-0.4.2 spec/string_spec.rb
jnunemaker-httparty-0.4.3 spec/string_spec.rb
kerryb-httparty-0.3.2 spec/string_spec.rb
kerryb-httparty-0.3.3 spec/string_spec.rb
kerryb-httparty-0.4.3 spec/string_spec.rb
leh-httparty-0.3.1.1 spec/string_spec.rb
mfilej-httparty-0.4.3 spec/string_spec.rb
timriley-httparty-0.3.1 spec/string_spec.rb
timriley-httparty-0.3.2 spec/string_spec.rb
voxdolo-httparty-0.3.1 spec/string_spec.rb
voxdolo-httparty-0.4.1 spec/string_spec.rb
httparty-0.3.1 spec/string_spec.rb
httparty-0.3.0 spec/string_spec.rb