Sha256: 91525a801147566bbd509f651b5afe3a8a7fbe71deea7ecd8a3c0313ae89b159

Contents?: true

Size: 732 Bytes

Versions: 15

Compression:

Stored size: 732 Bytes

Contents

require 'spec_helper'

describe MailRoom::Configuration do
  let(:config_path) {File.expand_path('../fixtures/test_config.yml', File.dirname(__FILE__))}

  describe 'set_mailboxes' do
    it 'parses yaml into mailbox objects' do
      MailRoom::Mailbox.stubs(:new).returns('mailbox1', 'mailbox2')

      configuration = MailRoom::Configuration.new(:config_path => config_path)

      configuration.mailboxes.should eq(['mailbox1', 'mailbox2'])
    end

    it 'sets mailboxes to an empty set when config_path is missing' do
      MailRoom::Mailbox.stubs(:new)

      configuration = MailRoom::Configuration.new

      configuration.mailboxes.should eq([])

      MailRoom::Mailbox.should have_received(:new).never
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mail_room-0.7.0 spec/lib/configuration_spec.rb
mail_room-0.6.1 spec/lib/configuration_spec.rb
mail_room-0.6.0 spec/lib/configuration_spec.rb
mail_room-0.5.2 spec/lib/configuration_spec.rb
mail_room-0.5.1 spec/lib/configuration_spec.rb
mail_room-0.5.0 spec/lib/configuration_spec.rb
mail_room-0.4.2 spec/lib/configuration_spec.rb
mail_room-0.4.1 spec/lib/configuration_spec.rb
mail_room-0.4.0 spec/lib/configuration_spec.rb
mail_room-0.3.1 spec/lib/configuration_spec.rb
mail_room-0.3.0 spec/lib/configuration_spec.rb
mail_room-0.2.0 spec/lib/configuration_spec.rb
mail_room-0.1.0 spec/lib/configuration_spec.rb
mail_room-0.0.3 spec/lib/configuration_spec.rb
mail_room-0.0.2 spec/lib/configuration_spec.rb