Sha256: 22397f03dc2fc63e5417bbeb733064dbb30984944c8c8936c8a87af12ab821cf

Contents?: true

Size: 474 Bytes

Versions: 5

Compression:

Stored size: 474 Bytes

Contents

require 'spec_helper'

describe Protobuf::Util do
  
  describe '.underscore' do
    it 'underscores constant name' do
      Protobuf::Util.underscore("HelloMoto").should eq "hello_moto"
    end
    
    context 'when constant name has uppercased word' do
      it 'keeps the uppercased word together' do
        Protobuf::Util.underscore("UPPERCase").should eq "upper_case"
        Protobuf::Util.underscore("MDXService").should eq "mdx_service"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
protobuf-1.4.2 spec/unit/common/util_spec.rb
protobuf-1.4.1 spec/unit/common/util_spec.rb
protobuf-1.4.0 spec/unit/common/util_spec.rb
protobuf-1.3.0 spec/unit/common/util_spec.rb
protobuf-1.1.3 spec/unit/common/util_spec.rb