Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4924

Config spec: tests fail with default host 127.0.0.1, expecting a ":"

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 7.2.0.rc1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The following test fails in config_spec.rb when the MONGODB_URI environment variable is not set.

      it "sets the default hosts" do
        expect(default[:hosts]).to eq(SpecConfig.instance.addresses)
        # and make sure the value is not empty
        expect(default[:hosts].first).to include(':')
      end

      In spec_config.rb, the default host is set to "127.0.0.1", which doesn't have a ":" and thus fails.

       

      Here is the error:

      Failure/Error: expect(default[:hosts].first).to include(':')
        expected "127.0.0.1" to include ":"
      # ./spec/mongoid/config_spec.rb:413:in `block (6 levels) in <top (required)>' 

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: