Sha256: 62ad381b8fdbab3b02189c770bed41b0ebec1304a73049ae0f277c724c79bdc0

Contents?: true

Size: 1.14 KB

Versions: 13

Compression:

Stored size: 1.14 KB

Contents

describe Ppl::Format::AddressBook::MuttQuery do

  before(:each) do
    @format       = Ppl::Format::AddressBook::MuttQuery.new
    @address_book = Ppl::Entity::AddressBook.new
    @contact      = Ppl::Entity::Contact.new
    @table        = double(Ppl::Format::Table)

    @contact.email_addresses << Ppl::Entity::EmailAddress.new("test@example.org")
    @contact.name = "Test Contact"

    @format.table = @table
    @address_book.contacts.push(@contact)
  end

  describe "#process" do

    it "should list the given contacts" do
      @table.should_receive(:add_row).with({
        :email => "test@example.org",
        :name  => "Test Contact",
      })
      @format.process(@address_book)
    end

    it "should list all of each contact's email addresses" do
      @contact.email_addresses << Ppl::Entity::EmailAddress.new("test2@example.com")
      @table.should_receive(:add_row).with({
        :email => "test@example.org",
        :name  => "Test Contact",
      })
      @table.should_receive(:add_row).with({
        :email => "test2@example.com",
        :name  => "Test Contact",
      })
      @format.process(@address_book)
    end

  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ppl-3.0.1 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-3.0.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-2.4.1 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-2.4.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-2.3.3 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-2.3.2 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-2.3.1 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-2.3.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-2.2.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-2.1.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-2.0.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.25.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.24.0 spec/ppl/format/address_book/mutt_query_spec.rb