Sha256: 50d03614a5326ccbe19e8ef978ebcdf6da857b3821c8765b1ccff09161c6923c

Contents?: true

Size: 731 Bytes

Versions: 4

Compression:

Stored size: 731 Bytes

Contents

require 'spec_helper'

RSpec.describe Kanade::NamingStrategy::CamelCase do
  subject do
    Kanade::NamingStrategy::CamelCase.new
  end

  it 'can serialize' do
    expect(subject.serialize(:camel_case)).to eq('camelCase')
    expect(subject.serialize(:oneword)).to eq('oneword')
  end

  it 'can deserialize' do
    expect(subject.deserialize('camelCase')).to eq(:camel_case)
    expect(subject.deserialize('oneword')).to eq(:oneword)
  end

  it 'does not understand dictionary' do
    expect(subject.serialize(:xml_serializer)).to eq('xmlSerializer')
    expect(subject.deserialize('xmlSerializer')).to eq(:xml_serializer)
    expect(subject.deserialize('XMLSerializer')).to eq(:xml_serializer)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kanade-0.1.1 spec/naming_strategy/camel_case_spec.rb
kanade-0.1.0 spec/naming_strategy/camel_case_spec.rb
kanade-0.1.0.beta2 spec/naming_strategy/camel_case_spec.rb
kanade-0.1.0.beta1 spec/naming_strategy/camel_case_spec.rb