Sha256: 30fb690b4b3e5ba10a31b8e57d0b0d717aeb7f951ff8539890375d7ef4fc89fd

Contents?: true

Size: 491 Bytes

Versions: 16

Compression:

Stored size: 491 Bytes

Contents

describe Mrkt::Errors do
  describe '.find_by_response_code' do
    subject { described_class.find_by_response_code(code) }

    context 'when the code is' do
      context 'known' do
        let(:code) { 413 }

        it 'should return the mapped error class' do
          is_expected.to eq(Mrkt::Errors::RequestEntityTooLarge)
        end
      end

      context 'unknown' do
        let(:code) { 7331 }

        it { is_expected.to eq(Mrkt::Errors::Error) }
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mrkt-1.2.0 spec/errors_spec.rb
mrkt-1.1.1 spec/errors_spec.rb
mrkt-1.1.0 spec/errors_spec.rb
mrkt-1.0.1 spec/errors_spec.rb
mrkt-1.0.0 spec/errors_spec.rb
mrkt-0.11.1 spec/errors_spec.rb
mrkt-0.11.0 spec/errors_spec.rb
mrkt-0.10.0 spec/errors_spec.rb
mrkt-0.9.0 spec/errors_spec.rb
mrkt-0.8.0 spec/errors_spec.rb
mrkt-0.7.0 spec/errors_spec.rb
mrkt-0.6.2 spec/errors_spec.rb
mrkt-0.6.1 spec/errors_spec.rb
mrkt-0.6.0 spec/errors_spec.rb
mrkt-0.5.0 spec/errors_spec.rb
mrkt-0.4.0 spec/errors_spec.rb