Sha256: 5a8268a1348a3832c4a95314bb262773bc77b64993122240ea037cf480d3f946

Contents?: true

Size: 776 Bytes

Versions: 4

Compression:

Stored size: 776 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

require "spec_helper"

describe Mongoid::Errors::NoClientHosts do

  describe "#message" do

    let(:error) do
      described_class.new(:secondary, { database: "mongoid_test" })
    end

    it "contains the problem in the message" do
      expect(error.message).to include(
        "No hosts provided for client configuration: :secondary."
      )
    end

    it "contains the summary in the message" do
      expect(error.message).to include(
        "Each client configuration must provide hosts so Mongoid"
      )
    end

    it "contains the resolution in the message" do
      expect(error.message).to include(
        "If configuring via a mongoid.yml, ensure that within your :secondary"
      )
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mongoid-7.1.2 spec/mongoid/errors/no_client_hosts_spec.rb
mongoid-7.1.1 spec/mongoid/errors/no_client_hosts_spec.rb
mongoid-7.1.0 spec/mongoid/errors/no_client_hosts_spec.rb
mongoid-7.1.0.rc0 spec/mongoid/errors/no_client_hosts_spec.rb