Sha256: 1f4ecc470ed6e6a2c7fb1b745d71acd7c3d3f7f1717c0ff4c9694975718923ce

Contents?: true

Size: 1002 Bytes

Versions: 2

Compression:

Stored size: 1002 Bytes

Contents

require 'assert'

require 'inbox-sync/sync'

module InboxSync

  class ConfiguredSyncTests < Assert::Context
    desc "a sync that has been configured and setup"
    before do
      @sync = configured_sync
      @sync.setup
    end
    after do
      @sync.teardown
    end
    subject { @sync }

    should "be logged in" do
      assert subject.logged_in?
    end

    should "be logged out after teardown" do
      subject.teardown

      assert_not subject.logged_in?
    end

    should "set source IMAP and notify SMTP objects" do
      assert_kind_of Net::IMAP, subject.source_imap
      assert_kind_of Net::SMTP, subject.notify_smtp
    end

    should "remove source IMAP and notify SMTP objects after teardown" do
      subject.teardown

      assert_nil subject.source_imap
      assert_nil subject.notify_smtp
    end

    should "validate the configs on setup" do
      assert_raises ArgumentError do
        InboxSync::Sync.new(:logger => '/dev/null').setup
      end
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
inbox-sync-0.4.1 test/sync/login_test.rb
inbox-sync-0.4.0 test/sync/login_test.rb