Sha256: 7f2f99bb26fc735b0c09ef5455847eff9cff660eee9553f7c508ed0767efe305

Contents?: true

Size: 1.08 KB

Versions: 12

Compression:

Stored size: 1.08 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.push "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.push "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

12 entries across 12 versions & 1 rubygems

Version Path
ppl-1.23.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.22.2 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.22.1 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.22.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.21.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.20.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.19.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.18.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.17.2 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.17.1 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.17.0 spec/ppl/format/address_book/mutt_query_spec.rb
ppl-1.16.0 spec/ppl/format/address_book/mutt_query_spec.rb