Sha256: 85d388f157883effb9057f6a931216bd9146b87289339a97ede6a9c4d6bf57d8

Contents?: true

Size: 573 Bytes

Versions: 4

Compression:

Stored size: 573 Bytes

Contents

require 'spec_helper'

require 'cloud_shaped/camelate'

using CloudShaped::Camelate

describe String, "#camelate" do
  it "is a no-op" do
    expect("foobar".camelate).to eq("foobar")
  end
end

describe Symbol, "#camelate" do
  it "returns a CamelCased string" do
    expect(:foo_bar.camelate).to eq("FooBar")
  end
end

describe Hash, "#camelate_keys" do

  it "camelates the keys" do
    original_hash = {
      :foo_bar => 123,
      "BlahBlah" => 456
    }
    expect(original_hash.camelate_keys).to eq(
      "FooBar" => 123,
      "BlahBlah" => 456
    )
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cloud_shaped-0.1.1 spec/cloud_shaped/camelate_spec.rb
cloud_shaped-0.1.0 spec/cloud_shaped/camelate_spec.rb
cloud_shaped-0.0.2 spec/cloud_shaped/camelate_spec.rb
cloud_shaped-0.0.1 spec/cloud_shaped/camelate_spec.rb