Sha256: 5dc74f2342c5ce3b97b555e029e1f082d2b3ec0965d53bf072533476f5cc273e

Contents?: true

Size: 527 Bytes

Versions: 19

Compression:

Stored size: 527 Bytes

Contents

describe "String#underscore" do
  it "replaces '-' in dasherized strings with underscores" do
    "well-hello-there".underscore.should == "well_hello_there"
  end
  
  it "converts single all-upcase strings into lowercase" do
    "OMG".underscore.should == "omg"
  end
  
  it "splits word bounderies and seperates using underscore" do
    "AdamBeynon".underscore.should == "adam_beynon"
  end
  
  it "does not split when 2 or more capitalized letters together" do
    "HTMLParser".underscore.should == "html_parser"
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
opal-0.3.43 spec/rubyspec/core/string/underscore_spec.rb
opal-0.3.42 spec/core/string/underscore_spec.rb
opal-0.3.41 spec/core/string/underscore_spec.rb
opal-0.3.40 spec/core/string/underscore_spec.rb
opal-0.3.39 spec/core/string/underscore_spec.rb
opal-0.3.38 spec/core/string/underscore_spec.rb
opal-0.3.37 spec/core/string/underscore_spec.rb
opal-0.3.36 spec/core/string/underscore_spec.rb
opal-0.3.35 spec/core/string/underscore_spec.rb
opal-0.3.34 spec/core/string/underscore_spec.rb
opal-0.3.33 spec/core/string/underscore_spec.rb
opal-0.3.32 spec/core/string/underscore_spec.rb
opal-0.3.31 spec/core/string/underscore_spec.rb
opal-0.3.30 spec/core/string/underscore_spec.rb
opal-0.3.29 spec/core/string/underscore_spec.rb
opal-0.3.28 spec/core/string/underscore_spec.rb
opal-0.3.27 spec/opal/string/underscore_spec.rb
opal-0.3.26 spec/opal/string/underscore_spec.rb
opal-0.3.25 spec/opal/string/underscore_spec.rb