Sha256: 54090d5432277bfebaca2c870b637140b0faa623da97b2295d32af216e5065ad

Contents?: true

Size: 459 Bytes

Versions: 13

Compression:

Stored size: 459 Bytes

Contents

describe Moneta::Api::HTTPException do
  let(:message) { 'Server Error' }
  let(:code) { '500' }

  let(:exception) { described_class.new(message).tap { |e| e.code = code } }

  describe '.to_hash' do
    subject { exception.to_hash }

    its([:message]) { is_expected.to eq message }
    its([:code]) { is_expected.to eq code }
  end

  describe '.inspect' do
    subject { exception }

    its(:inspect) { is_expected.to eq '500: Server Error' }
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
moneta-api-1.13.0 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.12.8 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.12.7 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.12.6 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.12.5 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.12.4 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.12.3 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.12.2 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.12.1 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.12.0 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.11.0 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.10.0 spec/lib/moneta/api/http_exception_spec.rb
moneta-api-1.9.0 spec/lib/moneta/api/http_exception_spec.rb