Sha256: 4b861919003db899e7ecbe7ea512adb7ac63e734e35718cbb4b65d8effc1df64

Contents?: true

Size: 741 Bytes

Versions: 5

Compression:

Stored size: 741 Bytes

Contents

#          Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the MIT license.

require File.expand_path('../../../../lib/ramaze/spec/helper/snippets', __FILE__)

describe "String#camel_case" do

  it 'should camelize snake_case' do
    'foo_bar'.camel_case.should == 'FooBar'
  end

  it 'should camelize snake_case_long' do
    'foo_bar_baz'.camel_case.should == 'FooBarBaz'
  end

  it 'should ignore starting _' do
    '_foo_bar_baz'.camel_case.should == 'FooBarBaz'
  end

  it 'should ignore trailing _' do
    'foo_bar_baz_'.camel_case.should == 'FooBarBaz'
  end

  it 'messes up existing CamelCase' do
    'foo_barBaz'.camel_case.should == 'FooBarbaz'
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ramaze-2023.01.06 spec/snippets/string/camel_case.rb
ramaze-2012.12.08 spec/snippets/string/camel_case.rb
ramaze-2012.12.08b spec/snippets/string/camel_case.rb
ramaze-2012.04.14 spec/snippets/string/camel_case.rb
ramaze-2012.03.07 spec/snippets/string/camel_case.rb