Sha256: 6688aaa8f0bce07c08b3fd7a0c984110dd6ae162f6d1d76e90a32768d993a157

Contents?: true

Size: 606 Bytes

Versions: 3

Compression:

Stored size: 606 Bytes

Contents

require 'spec_helper'

describe Sparrow::Strategies::KeyTransformation::CamelizeKey do

  subject(:camelize_key_strategy) do
    Sparrow::Strategies::KeyTransformation::CamelizeKey.new
  end

  describe '#transform_key' do

    it 'should camelize its inputs (defaulting to lower case camelizing)' do
      output = camelize_key_strategy.transform_key('wireless_configuration')
      expect(output).to eq('wirelessConfiguration')
    end

    it 'should leave all_uppercase strings as they are' do
      output = camelize_key_strategy.transform_key('DE')
      expect(output).to eq('DE')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cp-sparrow-0.0.16 spec/unit/camelize_key_spec.rb
cp-sparrow-0.0.15 spec/unit/camelize_key_spec.rb
cp-sparrow-0.0.14 spec/unit/camelize_key_spec.rb