Sha256: 76aec9098a4465f282d2393580e04c7d6f4c243892f28903ea2bfaa7087fc1c8

Contents?: true

Size: 742 Bytes

Versions: 14

Compression:

Stored size: 742 Bytes

Contents

#          Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby 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

14 entries across 14 versions & 3 rubygems

Version Path
Pistos-ramaze-2009.06.12 spec/snippets/string/camel_case.rb
manveru-ramaze-2009.07 spec/snippets/string/camel_case.rb
ramaze-2011.12.28 spec/snippets/string/camel_case.rb
ramaze-2011.10.23 spec/snippets/string/camel_case.rb
ramaze-2011.07.25 spec/snippets/string/camel_case.rb
ramaze-2011.01.30 spec/snippets/string/camel_case.rb
ramaze-2011.01 spec/snippets/string/camel_case.rb
ramaze-2010.06.18 spec/snippets/string/camel_case.rb
ramaze-2010.04.04 spec/snippets/string/camel_case.rb
ramaze-2010.04 spec/snippets/string/camel_case.rb
ramaze-2010.03 spec/snippets/string/camel_case.rb
ramaze-2010.01 spec/snippets/string/camel_case.rb
ramaze-2009.10 spec/snippets/string/camel_case.rb
ramaze-2009.07 spec/snippets/string/camel_case.rb