Sha256: f6b9bd6f28af6401a7416470a4af62dbab85dbfb85b437efce567c32773a7403

Contents?: true

Size: 654 Bytes

Versions: 7

Compression:

Stored size: 654 Bytes

Contents

# frozen_string_literal: true

RSpec.describe BingAdsRubySdk::Postprocessors::Snakize do

  def action(params)
    described_class.new(params).call
  end

  it "changes keys to snake version" do
    expect(action({
      "Foo" => "foo",
      "BarBar" => {
        "BazBaz" => "baz"
      },
      "Coucou" => [
        {
          "Bisou" => 1
        }
      ]
    })).to eq({
      foo: "foo",
      bar_bar: {
        baz_baz: "baz"
      },
      coucou: [
        {
          bisou: 1
        }
      ]
    })
  end

  it "handles properly 'long' tag name" do
    expect(action({
      "long" => "1"
    })).to eq({
      long: "1"
    })
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bing_ads_ruby_sdk-1.3.4 spec/bing_ads_ruby_sdk/postprocessors/snakize_spec.rb
bing_ads_ruby_sdk-1.3.3 spec/bing_ads_ruby_sdk/postprocessors/snakize_spec.rb
bing_ads_ruby_sdk-1.3.2 spec/bing_ads_ruby_sdk/postprocessors/snakize_spec.rb
bing_ads_ruby_sdk-1.3.1 spec/bing_ads_ruby_sdk/postprocessors/snakize_spec.rb
bing_ads_ruby_sdk-1.3.0 spec/bing_ads_ruby_sdk/postprocessors/snakize_spec.rb
bing_ads_ruby_sdk-1.2.0 spec/bing_ads_ruby_sdk/postprocessors/snakize_spec.rb
bing_ads_ruby_sdk-1.1.1 spec/bing_ads_ruby_sdk/postprocessors/snakize_spec.rb