Sha256: 7cff570e260e244debc392d5596f82d6f7ea3f4af0c77cf8afc827a24c6b92ea

Contents?: true

Size: 981 Bytes

Versions: 19

Compression:

Stored size: 981 Bytes

Contents

describe Email::Provider do
  subject { described_class.new(:gmail) }

  describe ".for_address" do
    context "with known providers" do
      [
        ["gmail.com", :gmail],
        ["fastmail.fm", :fastmail]
      ].each do |domain, provider|
        it "recognizes #{provider}" do
          address = "foo@#{domain}"
          expect(described_class.for_address(address).provider).to eq(provider)
        end
      end
    end

    context "with unknown providers" do
      it "returns a default provider" do
        result = described_class.for_address("foo@unknown.com").provider
        expect(result).to eq(:default)
      end
    end
  end

  describe "#options" do
    it "returns options" do
      expect(subject.options).to be_a(Hash)
    end

    it "forces TLSv1_2" do
      expect(subject.options[:ssl][:ssl_version]).to eq(:TLSv1_2)
    end
  end

  describe "#host" do
    it "returns host" do
      expect(subject.host).to eq("imap.gmail.com")
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
imap-backup-4.0.2 spec/unit/email/provider_spec.rb
imap-backup-4.0.1 spec/unit/email/provider_spec.rb
imap-backup-4.0.0 spec/unit/email/provider_spec.rb
imap-backup-4.0.0.rc6 spec/unit/email/provider_spec.rb
imap-backup-4.0.0.rc5 spec/unit/email/provider_spec.rb
imap-backup-4.0.0.rc4 spec/unit/email/provider_spec.rb
imap-backup-4.0.0.rc3 spec/unit/email/provider_spec.rb
imap-backup-4.0.0.rc2 spec/unit/email/provider_spec.rb
imap-backup-4.0.0.rc1 spec/unit/email/provider_spec.rb
imap-backup-3.4.1 spec/unit/email/provider_spec.rb
imap-backup-3.4.0 spec/unit/email/provider_spec.rb
imap-backup-3.3.1 spec/unit/email/provider_spec.rb
imap-backup-3.3.0 spec/unit/email/provider_spec.rb
imap-backup-3.2.1 spec/unit/email/provider_spec.rb
imap-backup-3.2.0 spec/unit/email/provider_spec.rb
imap-backup-3.1.0 spec/unit/email/provider_spec.rb
imap-backup-3.0.0 spec/unit/email/provider_spec.rb
imap-backup-3.0.0.rc1 spec/unit/email/provider_spec.rb
imap-backup-2.2.2 spec/unit/email/provider_spec.rb