Sha256: d59df3cf31cffc9e69fae607d0e13ea6ed6f973969e09acc6cd71a11b56cb096
Contents?: true
Size: 852 Bytes
Versions: 3
Compression:
Stored size: 852 Bytes
Contents
describe Ppl::Format::Contact::Nicknames do before(:each) do @format = Ppl::Format::Contact::Nicknames.new @contact = Ppl::Entity::Contact.new @color = double(Ppl::Adapter::Color) @format.color_adapter = @color end describe "#process" do it "should return an empty string if the contact lacks a nickname" do expect(@format.process(Ppl::Entity::Contact.new)).to eq "" end it "should return the contact's nickname if one is set" do @contact.nicknames.push("Dopey") expect(@format.process(@contact)).to eq "Dopey" end it "should colorize the string if configured to do so" do @format.colors = { "nicknames" => "blue" } expect(@color).to receive(:colorize).and_return("nicknames in blue") expect(@format.process(@contact)).to eq "nicknames in blue" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ppl-4.0.5 | spec/ppl/format/contact/nicknames_spec.rb |
ppl-4.0.3 | spec/ppl/format/contact/nicknames_spec.rb |
ppl-4.0.2 | spec/ppl/format/contact/nicknames_spec.rb |