Sha256: 4c8cc57dd89c3ba5863843eeb3563895bfbeef50d61b42ce65741140daa64693

Contents?: true

Size: 379 Bytes

Versions: 20

Compression:

Stored size: 379 Bytes

Contents

# frozen_string_literal: true

require_relative 'smtp_mock/core'

module SmtpMock
  class << self
    def start_server(server = SmtpMock::Server, **options)
      server.new(**options)
    end

    def running_servers
      ::ObjectSpace.each_object(SmtpMock::Server).select(&:active?)
    end

    def stop_running_servers!
      running_servers.all?(&:stop!)
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
smtp_mock-1.4.4 lib/smtp_mock.rb
smtp_mock-1.4.3 lib/smtp_mock.rb
smtp_mock-1.4.1 lib/smtp_mock.rb
smtp_mock-1.4.0 lib/smtp_mock.rb
smtp_mock-1.3.6 lib/smtp_mock.rb
smtp_mock-1.3.5 lib/smtp_mock.rb
smtp_mock-1.3.4 lib/smtp_mock.rb
smtp_mock-1.3.3 lib/smtp_mock.rb
smtp_mock-1.3.2 lib/smtp_mock.rb
smtp_mock-1.3.1 lib/smtp_mock.rb
smtp_mock-1.3.0 lib/smtp_mock.rb
smtp_mock-1.2.2 lib/smtp_mock.rb
smtp_mock-1.2.1 lib/smtp_mock.rb
smtp_mock-1.2.0 lib/smtp_mock.rb
smtp_mock-1.1.0 lib/smtp_mock.rb
smtp_mock-1.0.1 lib/smtp_mock.rb
smtp_mock-1.0.0 lib/smtp_mock.rb
smtp_mock-0.1.2 lib/smtp_mock.rb
smtp_mock-0.1.1 lib/smtp_mock.rb
smtp_mock-0.1.0 lib/smtp_mock.rb