spec/ppl/command/mutt_spec.rb in ppl-1.23.0 vs spec/ppl/command/mutt_spec.rb in ppl-1.24.0
- old
+ new
@@ -35,11 +35,11 @@
end
it "should return email address matches" do
@contact.name = "Test User"
- @contact.email_addresses.push "test@example.org"
+ @contact.email_addresses << Ppl::Entity::EmailAddress.new("test@example.org")
@address_book.contacts.push(@contact)
@input.arguments.push "example"
@storage.should_receive(:load_address_book).and_return(@address_book)
@@ -53,26 +53,26 @@
it "should only return matching email addresses" do
@input.arguments.push "prova"
@contact.name = "Test User"
- @contact.email_addresses.push "test@test.org"
- @contact.email_addresses.push "prova@prova.org"
+ @contact.email_addresses << Ppl::Entity::EmailAddress.new("test@test.org")
+ @contact.email_addresses << Ppl::Entity::EmailAddress.new("prova@prova.org")
@address_book.contacts.push(@contact)
@storage.stub(:load_address_book).and_return(@address_book)
@format.should_receive(:process) do |address_book|
address_book.contacts[0].email_addresses.length.should eq 1
- address_book.contacts[0].email_addresses[0].should eq "prova@prova.org"
+ address_book.contacts[0].email_addresses[0].address.should eq "prova@prova.org"
end
@output.stub(:line)
@command.execute(@input, @output)
end
it "should return name matches" do
@contact.name = "Test User"
- @contact.email_addresses.push "test@example.org"
+ @contact.email_addresses << Ppl::Entity::EmailAddress.new("test@example.org")
@address_book.contacts.push(@contact)
@input.arguments.push "User"
@storage.should_receive(:load_address_book).and_return(@address_book)
@@ -87,12 +87,12 @@
it "should count up email addresses in the status line" do
@input.arguments.push "org"
@contact.name = "Test User"
- @contact.email_addresses.push "test@test.org"
- @contact.email_addresses.push "prova@prova.org"
+ @contact.email_addresses << Ppl::Entity::EmailAddress.new("test@test.org")
+ @contact.email_addresses << Ppl::Entity::EmailAddress.new("prova@prova.org")
@address_book.contacts << @contact
@storage.stub(:load_address_book).and_return(@address_book)
@format.stub(:process)
@output.stub(:line)
@@ -107,12 +107,12 @@
describe "#execute (case-insensitive)" do
before(:each) do
@input.options[:ignore_case] = true
@contact.name = "Joe Schmoe"
- @contact.email_addresses.push "joe@somewhere.com"
- @contact.email_addresses.push "LOUD@SHOUTING.COM"
+ @contact.email_addresses << Ppl::Entity::EmailAddress.new("joe@somewhere.com")
+ @contact.email_addresses << Ppl::Entity::EmailAddress.new("LOUD@SHOUTING.COM")
@address_book.contacts << @contact
@storage.stub(:load_address_book).and_return(@address_book)
@output.stub(:line)
end
@@ -126,10 +126,10 @@
it "should ignore case when matching email addresses" do
@input.arguments.push "loud"
@format.should_receive(:process) do |address_book|
address_book.contacts[0].email_addresses.length.should eq 1
- address_book.contacts[0].email_addresses[0].should eq "LOUD@SHOUTING.COM"
+ address_book.contacts[0].email_addresses[0].address.should eq "LOUD@SHOUTING.COM"
end
@command.execute(@input, @output)
end
end