Rspec not passing because class id is different

Whenever i run rspec! My save method won’t pass. If you guys could look at my code and give any advice it would be greatly appreciated. Note, the expected output in Rspec is almost identical to what it got, except for the Doctor class id. I’m trying to insert my newly created instance of Doctor into my database.

Error

1) Doctor #save saves a doctor into the db
 Failure/Error: expect(Doctor.all()).to(eq([doctor]))

   expected: [#<Doctor:0x00007fdc11209d70 @name="Ed", @specialty="depression", @id=36>]
        got: [#<Doctor:0x00007fdc11209988 @name="Ed", @specialty="depression", @id=36>]

   (compared using ==)

   Diff:
   @@ -1,2 +1,2 @@
   -[#<Doctor:0x00007fdc11209d70 @name="Ed", @specialty="depression", @id=36>]
   +[#<Doctor:0x00007fdc11209988 @name="Ed", @specialty="depression", @id=36>]

 # ./spec/doctor_spec.rb:24:in `block (3 levels) in <top (required)>'

Finished in 0.0197 seconds (files took 0.30462 seconds to load)
2 examples, 1 failure

Failed examples:

rspec ./spec/doctor_spec.rb:21 # Doctor #save saves a doctor into the db

doctor_spec.rb

require("rspec")
require("pg")
require("doctor")

DB = PG.connect({:dbname => 'doctors_test'})

RSpec.configure do |config|
  config.after(:each) do
    DB.exec("DELETE FROM doctor *;")
  end
end

describe("Doctor") do
  describe(".all") do
    it("returns empty at first") do
      expect(Doctor.all()).to(eq([]))
    end
  end

  describe("#save") do
    it("saves a doctor into the db") do
      doctor = Doctor.new({:name => "Ed", :specialty => "depression", :id => nil})
      doctor.save()
      expect(Doctor.all()).to(eq([doctor]))
    end
  end
end

doctor.rb

require("pry")
require("pg")

class Doctor

  attr_reader(:name, :specialty, :id)

  def initialize(attributes)
    @name = attributes.fetch(:name)
    @specialty = attributes.fetch(:specialty)
    @id = attributes.fetch(:id)
  end

  def self.all()
    returned_array = DB.exec("SELECT * FROM doctor;")
    doctors = []
    returned_array.each() do |doc|
      name = doc.fetch("name")
      specialty = doc.fetch("specialty")
      id = doc.fetch("id").to_i()
      doctors.push(Doctor.new({
        :name => name,
        :specialty => specialty,
        :id => id
      }))
    end
    doctors
  end

  def save
    result = DB.exec("INSERT INTO doctor (name, specialty) VALUES ('#{@name}', '#{@specialty}') RETURNING id;")
    @id = result.first().fetch("id").to_i()
  end
end