Sha256: 59715cf6c8108e9969cb3498096f6d56adadd3693ca36e1c8a6055ed13e703d8

Contents?: true

Size: 606 Bytes

Versions: 12

Compression:

Stored size: 606 Bytes

Contents

require 'spec_helper'
require 'routemaster/errors'

describe Routemaster::Errors::FatalResource do
  let(:body) { "{ \"foo\": \"bar\" }" }
  let(:env) { double(body: body, url: '/foo/bar', method: 'GET') }
  subject(:error) { described_class.new(env) }

  describe "#message" do
    subject { error.message }
    it { is_expected.to eq "Fatal Resource Error. body: { \"foo\": \"bar\" }, url: /foo/bar, method: GET" }

    context 'even if the body is string' do
      let(:body) { "foobar" }
      it { is_expected.to eq "Fatal Resource Error. body: foobar, url: /foo/bar, method: GET" }
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
routemaster-drain-3.7.1 spec/routemaster/errors_spec.rb
routemaster-drain-3.7.0 spec/routemaster/errors_spec.rb
routemaster-drain-3.6.8 spec/routemaster/errors_spec.rb
routemaster-drain-3.6.7 spec/routemaster/errors_spec.rb
routemaster-drain-3.6.6 spec/routemaster/errors_spec.rb
routemaster-drain-3.6.5 spec/routemaster/errors_spec.rb
routemaster-drain-3.6.4 spec/routemaster/errors_spec.rb
routemaster-drain-3.6.3 spec/routemaster/errors_spec.rb
routemaster-drain-3.6.2 spec/routemaster/errors_spec.rb
routemaster-drain-3.6.1 spec/routemaster/errors_spec.rb
routemaster-drain-3.6.0 spec/routemaster/errors_spec.rb
routemaster-drain-3.5.1 spec/routemaster/errors_spec.rb