Sha256: c9c7f52c50a4c278069f0ede6d51e1ec82536a78c753b5730611ee4346796aa8

Contents?: true

Size: 918 Bytes

Versions: 18

Compression:

Stored size: 918 Bytes

Contents

require 'test_helper'

class CrackTest < Test::Unit::TestCase
  context "snake_case" do
    should "lowercases one word CamelCase" do
      "Merb".snake_case.should == "merb"
    end

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

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

    should "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

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

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

Version data entries

18 entries across 18 versions & 8 rubygems

Version Path
alistairholt-crack-0.1.4 test/string_test.rb
benschwarz-smoke-0.5.0 vendor/crack/test/string_test.rb
benschwarz-smoke-0.5.1 vendor/crack/test/string_test.rb
jnunemaker-crack-0.1.4 test/string_test.rb
mdub-crack-0.1.4 test/string_test.rb
mdub-crack-0.1.5 test/string_test.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/crack-0.1.8/test/string_test.rb
crack-0.2.0 test/string_test.rb
crackoid-1.0.1 test/string_test.rb
crackoid-1.0.0 test/string_test.rb
crackoid-0.0.1 test/string_test.rb
putio-0.0.1.pre2 development/ruby/1.8/gems/crack-0.1.8/test/string_test.rb
putio-0.0.1.pre development/ruby/1.8/gems/crack-0.1.8/test/string_test.rb
crack-0.1.8 test/string_test.rb
crack-0.1.7 test/string_test.rb
crack-0.1.6 test/string_test.rb
crack-0.1.5 test/string_test.rb
crack-0.1.4 test/string_test.rb