Sha256: 1422418bf7147712bfa8aaeb4bfacb384a3b1f87e6c1b3c06ffbf347f47c5775

Contents?: true

Size: 502 Bytes

Versions: 137

Compression:

Stored size: 502 Bytes

Contents

# frozen_string_literal: true

shared_examples 'a params encoder' do
  it 'escapes safe buffer' do
    monies = FakeSafeBuffer.new('$32,000.00')
    expect(subject.encode('a' => monies)).to eq('a=%2432%2C000.00')
  end

  it 'raises type error for empty string' do
    expect { subject.encode('') }.to raise_error(TypeError) do |error|
      expect(error.message).to eq("Can't convert String into Hash.")
    end
  end

  it 'encodes nil' do
    expect(subject.encode('a' => nil)).to eq('a')
  end
end

Version data entries

137 entries across 124 versions & 18 rubygems

Version Path
faraday-2.12.1 spec/support/shared_examples/params_encoder.rb
moneykit-0.1.15 vendor/bundle/ruby/3.2.0/gems/faraday-2.7.12/spec/support/shared_examples/params_encoder.rb
moneykit-0.1.14 vendor/bundle/ruby/3.2.0/gems/faraday-2.7.12/spec/support/shared_examples/params_encoder.rb
faraday-1.10.4 spec/support/shared_examples/params_encoder.rb
faraday-2.12.0 spec/support/shared_examples/params_encoder.rb
faraday-2.11.0 spec/support/shared_examples/params_encoder.rb
moneykit-0.1.13 vendor/bundle/ruby/3.2.0/gems/faraday-2.7.12/spec/support/shared_examples/params_encoder.rb
moneykit-0.1.12 vendor/bundle/ruby/3.2.0/gems/faraday-2.7.12/spec/support/shared_examples/params_encoder.rb
moneykit-0.1.11 vendor/bundle/ruby/3.2.0/gems/faraday-2.7.12/spec/support/shared_examples/params_encoder.rb
faraday-2.10.1 spec/support/shared_examples/params_encoder.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/faraday-1.2.0/spec/support/shared_examples/params_encoder.rb
faraday-2.10.0 spec/support/shared_examples/params_encoder.rb
faraday-2.9.2 spec/support/shared_examples/params_encoder.rb
faraday-2.9.1 spec/support/shared_examples/params_encoder.rb
moneykit-0.1.10 vendor/bundle/ruby/3.2.0/gems/faraday-2.7.12/spec/support/shared_examples/params_encoder.rb
moneykit-0.1.9 vendor/bundle/ruby/3.2.0/gems/faraday-2.7.12/spec/support/shared_examples/params_encoder.rb
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/faraday-1.10.3/spec/support/shared_examples/params_encoder.rb
moneykit-0.1.6 vendor/bundle/ruby/3.2.0/gems/faraday-2.7.12/spec/support/shared_examples/params_encoder.rb
moneykit-0.1.5 vendor/bundle/ruby/3.2.0/gems/faraday-2.7.12/spec/support/shared_examples/params_encoder.rb
moneykit-0.1.4 vendor/bundle/ruby/3.2.0/gems/faraday-2.7.12/spec/support/shared_examples/params_encoder.rb