Sha256: fea257a7d19e4c72faeb0398e62b977d6edf7e72f402b3d9ed1b5cc6816608cb
Contents?: true
Size: 1.12 KB
Versions: 27
Compression:
Stored size: 1.12 KB
Contents
describe Ppl::Format::AddressBook::Names do describe "#initialize" do it "should pass the colors through to the table" do colors = {"id" => "blue"} Ppl::Format::Table.should_receive(:new).with([:id, :name], colors) format = Ppl::Format::AddressBook::Names.new(colors) end end end describe Ppl::Format::AddressBook::Names do before(:each) do @format = Ppl::Format::AddressBook::Names.new @address_book = Ppl::Entity::AddressBook.new @contact = Ppl::Entity::Contact.new @table = double(Ppl::Format::Table) @contact.id = "test" @format.table = @table @address_book.contacts.push(@contact) end describe "#process" do it "should at least show the contact's id" do @table.should_receive(:add_row).with({ :id => "test:", :name => nil, }) @format.process(@address_book) end it "should show the name if it's available" do @contact.name = "John Doe" @table.should_receive(:add_row).with({ :id => "test:", :name => "John Doe", }) @format.process(@address_book) end end end
Version data entries
27 entries across 27 versions & 1 rubygems