Sha256: 93ecdccc8c1e718c9b0a5d92b0c3a60ddf30bf1b761d575ce4fa03b57e7b189d
Contents?: true
Size: 1.35 KB
Versions: 3
Compression:
Stored size: 1.35 KB
Contents
describe Ppl::Format::AddressBook::Nicknames do describe "#initialize" do it "should pass the colors through to the table" do colors = {"id" => "blue"} expect(Ppl::Format::Table).to receive(:new).with([:id, :nicknames], colors) format = Ppl::Format::AddressBook::Nicknames.new(colors) end end end describe Ppl::Format::AddressBook::Nicknames do before(:each) do @format = Ppl::Format::AddressBook::Nicknames.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 expect(@table).to receive(:add_row).with({ :id => "test:", :nicknames => "", }) @format.process(@address_book) end it "should show a nickname if it's available" do @contact.nicknames.push("Stupid") expect(@table).to receive(:add_row).with({ :id => "test:", :nicknames => "Stupid", }) @format.process(@address_book) end end describe "#disable_colors!" do it "should turn off the table's colors" do expect(@table).to receive(:disable_colors!) @format.disable_colors! end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ppl-4.0.5 | spec/ppl/format/address_book/nicknames_spec.rb |
ppl-4.0.3 | spec/ppl/format/address_book/nicknames_spec.rb |
ppl-4.0.2 | spec/ppl/format/address_book/nicknames_spec.rb |