ppl 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +1 -0
- data/features/step_definitions/ppl_steps.rb +3 -3
- data/ppl.gemspec +1 -1
- data/spec/ppl/adapter/color/colored_spec.rb +3 -3
- data/spec/ppl/adapter/email_scraper/mail_spec.rb +13 -13
- data/spec/ppl/adapter/output_spec.rb +7 -7
- data/spec/ppl/adapter/storage/disk_spec.rb +18 -18
- data/spec/ppl/adapter/storage/factory_spec.rb +3 -3
- data/spec/ppl/adapter/storage/git_spec.rb +31 -31
- data/spec/ppl/adapter/storage_spec.rb +3 -3
- data/spec/ppl/adapter/vcard/greencard_spec.rb +45 -45
- data/spec/ppl/application/bootstrap_spec.rb +128 -128
- data/spec/ppl/application/command_spec.rb +8 -8
- data/spec/ppl/application/command_suite_spec.rb +7 -7
- data/spec/ppl/application/configuration_spec.rb +16 -16
- data/spec/ppl/application/input_spec.rb +2 -2
- data/spec/ppl/application/router_spec.rb +8 -8
- data/spec/ppl/application/shell_spec.rb +39 -39
- data/spec/ppl/command/add_spec.rb +6 -6
- data/spec/ppl/command/age_spec.rb +7 -7
- data/spec/ppl/command/attribute_spec.rb +22 -22
- data/spec/ppl/command/bday_spec.rb +11 -11
- data/spec/ppl/command/completion_spec.rb +7 -7
- data/spec/ppl/command/email_spec.rb +19 -19
- data/spec/ppl/command/external_spec.rb +7 -7
- data/spec/ppl/command/help_spec.rb +15 -15
- data/spec/ppl/command/init_spec.rb +5 -5
- data/spec/ppl/command/ls_spec.rb +12 -12
- data/spec/ppl/command/mutt_spec.rb +33 -33
- data/spec/ppl/command/mv_spec.rb +11 -11
- data/spec/ppl/command/name_spec.rb +17 -17
- data/spec/ppl/command/nick_spec.rb +1 -1
- data/spec/ppl/command/org_spec.rb +1 -1
- data/spec/ppl/command/phone_spec.rb +15 -15
- data/spec/ppl/command/post_spec.rb +29 -29
- data/spec/ppl/command/rm_spec.rb +3 -3
- data/spec/ppl/command/scrape_spec.rb +24 -24
- data/spec/ppl/command/shell_spec.rb +41 -41
- data/spec/ppl/command/show_spec.rb +4 -4
- data/spec/ppl/command/url_spec.rb +1 -1
- data/spec/ppl/command/version_spec.rb +4 -4
- data/spec/ppl/entity/address_book_spec.rb +1 -1
- data/spec/ppl/entity/contact_spec.rb +16 -16
- data/spec/ppl/entity/email_address_spec.rb +3 -3
- data/spec/ppl/entity/name_spec.rb +1 -1
- data/spec/ppl/entity/phone_number_spec.rb +5 -5
- data/spec/ppl/entity/postal_address_spec.rb +2 -2
- data/spec/ppl/format/address_book/ages_spec.rb +3 -3
- data/spec/ppl/format/address_book/birthdays_spec.rb +3 -3
- data/spec/ppl/format/address_book/email_addresses_spec.rb +3 -3
- data/spec/ppl/format/address_book/mutt_query_spec.rb +3 -3
- data/spec/ppl/format/address_book/names_spec.rb +3 -3
- data/spec/ppl/format/address_book/nicknames_spec.rb +4 -4
- data/spec/ppl/format/address_book/one_line_spec.rb +5 -5
- data/spec/ppl/format/address_book/organizations_spec.rb +3 -3
- data/spec/ppl/format/address_book/phone_numbers_spec.rb +3 -3
- data/spec/ppl/format/address_book/postal_addresses_spec.rb +2 -2
- data/spec/ppl/format/address_book/urls_spec.rb +3 -3
- data/spec/ppl/format/contact/age_spec.rb +8 -8
- data/spec/ppl/format/contact/birthday_spec.rb +4 -4
- data/spec/ppl/format/contact/email_addresses_spec.rb +3 -3
- data/spec/ppl/format/contact/full_spec.rb +11 -11
- data/spec/ppl/format/contact/nicknames_spec.rb +4 -4
- data/spec/ppl/format/contact/organization_spec.rb +4 -4
- data/spec/ppl/format/contact/phone_number_spec.rb +4 -4
- data/spec/ppl/format/contact/postal_address_spec.rb +1 -1
- data/spec/ppl/format/contact/postal_addresses_spec.rb +3 -3
- data/spec/ppl/format/contact/urls_spec.rb +4 -4
- data/spec/ppl/format/custom/contact_spec.rb +13 -13
- data/spec/ppl/format/custom/email_address_spec.rb +3 -3
- data/spec/ppl/format/custom/phone_number_spec.rb +4 -4
- data/spec/ppl/format/custom_spec.rb +6 -6
- data/spec/ppl/format/name/full_only_spec.rb +4 -4
- data/spec/ppl/format/postal_address/multi_line_spec.rb +10 -10
- data/spec/ppl/format/postal_address/one_line_spec.rb +9 -9
- data/spec/ppl/format/table_spec.rb +11 -11
- data/spec/ppl/service/email_address_spec.rb +13 -13
- data/spec/ppl/service/name_spec.rb +9 -9
- data/spec/ppl/service/phone_number_spec.rb +11 -11
- data/spec/ppl/service/postal_address_spec.rb +20 -20
- data/spec/spec_helper.rb +3 -0
- metadata +1 -1
@@ -14,7 +14,7 @@ describe Ppl::Command::Show do
|
|
14
14
|
|
15
15
|
describe "#name" do
|
16
16
|
it "should be 'show'" do
|
17
|
-
@command.name.
|
17
|
+
expect(@command.name).to eq "show"
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -26,12 +26,12 @@ describe Ppl::Command::Show do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should show the contact's name" do
|
29
|
-
@storage.
|
30
|
-
@format.
|
29
|
+
expect(@storage).to receive(:require_contact).and_return(@contact)
|
30
|
+
expect(@format).to receive(:process).and_return("John Doe")
|
31
31
|
|
32
32
|
@input.arguments = ["john"]
|
33
33
|
|
34
|
-
@output.
|
34
|
+
expect(@output).to receive(:line).with("John Doe")
|
35
35
|
@command.execute(@input, @output)
|
36
36
|
end
|
37
37
|
end
|
@@ -8,16 +8,16 @@ describe Ppl::Command::Version do
|
|
8
8
|
|
9
9
|
describe "#name" do
|
10
10
|
it "should be 'version'" do
|
11
|
-
@command.name.
|
11
|
+
expect(@command.name).to eq "version"
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
describe "#execute" do
|
16
16
|
it "should show the version number" do
|
17
|
-
@output.
|
18
|
-
line.
|
17
|
+
expect(@output).to receive(:line) do |line|
|
18
|
+
expect(line).to include Ppl::Version
|
19
19
|
end
|
20
|
-
@command.execute(@input, @output).
|
20
|
+
expect(@command.execute(@input, @output)).to eq true
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -6,72 +6,72 @@ describe Ppl::Entity::Contact do
|
|
6
6
|
|
7
7
|
describe "#id" do
|
8
8
|
it "should return a value" do
|
9
|
-
@contact.id.
|
9
|
+
expect(@contact.id).to be nil
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
describe "#id=" do
|
14
14
|
it "should accept a value" do
|
15
15
|
@contact.id = "john"
|
16
|
-
@contact.id.
|
16
|
+
expect(@contact.id).to eq "john"
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe "#email_addresses" do
|
21
21
|
it "should return an array" do
|
22
|
-
@contact.email_addresses.
|
22
|
+
expect(@contact.email_addresses).to be_a(Array)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
describe "#postal_addresses" do
|
27
27
|
it "should return an array" do
|
28
|
-
@contact.postal_addresses.
|
28
|
+
expect(@contact.postal_addresses).to be_a(Array)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
describe "#birthday" do
|
33
33
|
it "should return a value" do
|
34
|
-
@contact.birthday.
|
34
|
+
expect(@contact.birthday).to eq nil
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
describe "#postal_address" do
|
39
39
|
it "should return a value" do
|
40
|
-
@contact.postal_address.
|
40
|
+
expect(@contact.postal_address).to eq nil
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
describe "#urls" do
|
45
45
|
it "should return an array" do
|
46
|
-
@contact.urls.
|
46
|
+
expect(@contact.urls).to be_a(Array)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
50
|
describe "#nicknames" do
|
51
51
|
it "should return an array" do
|
52
|
-
@contact.nicknames.
|
52
|
+
expect(@contact.nicknames).to be_a(Array)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
56
|
describe "#organizations" do
|
57
57
|
it "should return an array" do
|
58
|
-
@contact.organizations.
|
58
|
+
expect(@contact.organizations).to be_a(Array)
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
62
|
describe "#phone_numbers" do
|
63
63
|
it "should return an array" do
|
64
|
-
@contact.phone_numbers.
|
64
|
+
expect(@contact.phone_numbers).to be_a(Array)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
68
|
describe "#age" do
|
69
69
|
it "should return nil if the date of birth is unknown" do
|
70
|
-
@contact.age(Date.today).
|
70
|
+
expect(@contact.age(Date.today)).to eq nil
|
71
71
|
end
|
72
72
|
it "should return the contact's age" do
|
73
73
|
@contact.birthday = Date.parse("1970-01-01")
|
74
|
-
@contact.age(Date.parse("1980-01-02")).
|
74
|
+
expect(@contact.age(Date.parse("1980-01-02"))).to eq 10
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
@@ -82,12 +82,12 @@ describe Ppl::Entity::Contact do
|
|
82
82
|
end
|
83
83
|
|
84
84
|
it "returns nil if there's no preferred address" do
|
85
|
-
@contact.preferred_email_address.
|
85
|
+
expect(@contact.preferred_email_address).to eq nil
|
86
86
|
end
|
87
87
|
|
88
88
|
it "returns the preferred email address" do
|
89
89
|
@contact.email_addresses[0].preferred = true
|
90
|
-
@contact.preferred_email_address.
|
90
|
+
expect(@contact.preferred_email_address).to be_a(Ppl::Entity::EmailAddress)
|
91
91
|
end
|
92
92
|
|
93
93
|
end
|
@@ -99,12 +99,12 @@ describe Ppl::Entity::Contact do
|
|
99
99
|
end
|
100
100
|
|
101
101
|
it "returns nil if there's no preferred number" do
|
102
|
-
@contact.preferred_phone_number.
|
102
|
+
expect(@contact.preferred_phone_number).to eq nil
|
103
103
|
end
|
104
104
|
|
105
105
|
it "returns the preferred phone number" do
|
106
106
|
@contact.phone_numbers[0].preferred = true
|
107
|
-
@contact.preferred_phone_number.
|
107
|
+
expect(@contact.preferred_phone_number).to be_a(Ppl::Entity::PhoneNumber)
|
108
108
|
end
|
109
109
|
|
110
110
|
end
|
@@ -6,20 +6,20 @@ describe Ppl::Entity::EmailAddress do
|
|
6
6
|
|
7
7
|
describe "#address" do
|
8
8
|
it "should return a value" do
|
9
|
-
@email_address.address.
|
9
|
+
expect(@email_address.address).to eq nil
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
describe "#preferred" do
|
14
14
|
it "should be false by default" do
|
15
|
-
@email_address.preferred.
|
15
|
+
expect(@email_address.preferred).to eq false
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
describe "#initialize" do
|
20
20
|
it "should accept an address" do
|
21
21
|
email = Ppl::Entity::EmailAddress.new("bob@example.org")
|
22
|
-
email.address.
|
22
|
+
expect(email.address).to eq "bob@example.org"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -6,30 +6,30 @@ describe Ppl::Entity::PhoneNumber do
|
|
6
6
|
|
7
7
|
describe "#number" do
|
8
8
|
it "should return a value" do
|
9
|
-
@phone_number.number.
|
9
|
+
expect(@phone_number.number).to eq nil
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
describe "#preferred" do
|
14
14
|
it "should be false by default" do
|
15
|
-
@phone_number.preferred.
|
15
|
+
expect(@phone_number.preferred).to eq false
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
describe "#type" do
|
20
20
|
it "should return a value" do
|
21
|
-
@phone_number.type.
|
21
|
+
expect(@phone_number.type).to eq nil
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
describe "#initialize" do
|
26
26
|
it "should accept a number" do
|
27
27
|
phone = Ppl::Entity::PhoneNumber.new(12345)
|
28
|
-
phone.number.
|
28
|
+
expect(phone.number).to eq 12345
|
29
29
|
end
|
30
30
|
it "should accept a type" do
|
31
31
|
phone = Ppl::Entity::PhoneNumber.new(nil, "cell")
|
32
|
-
phone.type.
|
32
|
+
expect(phone.type).to eq "cell"
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -6,13 +6,13 @@ describe Ppl::Entity::PostalAddress do
|
|
6
6
|
|
7
7
|
describe "#preferred" do
|
8
8
|
it "should be false by default" do
|
9
|
-
@address.preferred.
|
9
|
+
expect(@address.preferred).to eq false
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
describe "#street" do
|
14
14
|
it "should return a value" do
|
15
|
-
@address.street.
|
15
|
+
expect(@address.street).to be nil
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -2,7 +2,7 @@ describe Ppl::Format::AddressBook::Ages do
|
|
2
2
|
describe "#initialize" do
|
3
3
|
it "should pass the colors through to the table" do
|
4
4
|
colors = {"id" => "blue"}
|
5
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :age], colors)
|
6
6
|
format = Ppl::Format::AddressBook::Ages.new(colors)
|
7
7
|
end
|
8
8
|
end
|
@@ -24,7 +24,7 @@ describe Ppl::Format::AddressBook::Ages do
|
|
24
24
|
describe "#process" do
|
25
25
|
|
26
26
|
it "should at least show the contact's id" do
|
27
|
-
@table.
|
27
|
+
expect(@table).to receive(:add_row).with({
|
28
28
|
:id => "test:",
|
29
29
|
:age => "",
|
30
30
|
})
|
@@ -33,7 +33,7 @@ describe Ppl::Format::AddressBook::Ages do
|
|
33
33
|
|
34
34
|
it "should show an age if it's available" do
|
35
35
|
@contact.birthday = Date.parse("1970-01-01")
|
36
|
-
@table.
|
36
|
+
expect(@table).to receive(:add_row).with({
|
37
37
|
:id => "test:",
|
38
38
|
:age => "10",
|
39
39
|
})
|
@@ -2,7 +2,7 @@ describe Ppl::Format::AddressBook::Birthdays do
|
|
2
2
|
describe "#initialize" do
|
3
3
|
it "should pass the colors through to the table" do
|
4
4
|
colors = {"id" => "blue"}
|
5
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :birthday], colors)
|
6
6
|
format = Ppl::Format::AddressBook::Birthdays.new(colors)
|
7
7
|
end
|
8
8
|
end
|
@@ -25,7 +25,7 @@ describe Ppl::Format::AddressBook::Birthdays do
|
|
25
25
|
describe "#process" do
|
26
26
|
|
27
27
|
it "should at least show the contact's id" do
|
28
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
29
29
|
:id => "test:",
|
30
30
|
:birthday => nil,
|
31
31
|
})
|
@@ -34,7 +34,7 @@ describe Ppl::Format::AddressBook::Birthdays do
|
|
34
34
|
|
35
35
|
it "should show the birthday if it's available" do
|
36
36
|
@contact.birthday = Date.parse("2001-02-03")
|
37
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
38
38
|
:id => "test:",
|
39
39
|
:birthday => "2001-02-03",
|
40
40
|
})
|
@@ -2,7 +2,7 @@ describe Ppl::Format::AddressBook::EmailAddresses do
|
|
2
2
|
describe "#initialize" do
|
3
3
|
it "should pass the colors through to the table" do
|
4
4
|
colors = {"id" => "blue"}
|
5
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :email_addresses], colors)
|
6
6
|
format = Ppl::Format::AddressBook::EmailAddresses.new(colors)
|
7
7
|
end
|
8
8
|
end
|
@@ -25,7 +25,7 @@ describe Ppl::Format::AddressBook::EmailAddresses do
|
|
25
25
|
describe "#process" do
|
26
26
|
|
27
27
|
it "should at least show the contact's id" do
|
28
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
29
29
|
:id => "test:",
|
30
30
|
:email_addresses => "",
|
31
31
|
})
|
@@ -34,7 +34,7 @@ describe Ppl::Format::AddressBook::EmailAddresses do
|
|
34
34
|
|
35
35
|
it "should show an email address if it's available" do
|
36
36
|
@contact.email_addresses << Ppl::Entity::EmailAddress.new("jdoe@example.org")
|
37
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
38
38
|
:id => "test:",
|
39
39
|
:email_addresses => "jdoe@example.org",
|
40
40
|
})
|
@@ -16,7 +16,7 @@ describe Ppl::Format::AddressBook::MuttQuery do
|
|
16
16
|
describe "#process" do
|
17
17
|
|
18
18
|
it "should list the given contacts" do
|
19
|
-
@table.
|
19
|
+
expect(@table).to receive(:add_row).with({
|
20
20
|
:email => "test@example.org",
|
21
21
|
:name => "Test Contact",
|
22
22
|
})
|
@@ -25,11 +25,11 @@ describe Ppl::Format::AddressBook::MuttQuery do
|
|
25
25
|
|
26
26
|
it "should list all of each contact's email addresses" do
|
27
27
|
@contact.email_addresses << Ppl::Entity::EmailAddress.new("test2@example.com")
|
28
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
29
29
|
:email => "test@example.org",
|
30
30
|
:name => "Test Contact",
|
31
31
|
})
|
32
|
-
@table.
|
32
|
+
expect(@table).to receive(:add_row).with({
|
33
33
|
:email => "test2@example.com",
|
34
34
|
:name => "Test Contact",
|
35
35
|
})
|
@@ -2,7 +2,7 @@ describe Ppl::Format::AddressBook::Names do
|
|
2
2
|
describe "#initialize" do
|
3
3
|
it "should pass the colors through to the table" do
|
4
4
|
colors = {"id" => "blue"}
|
5
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :name], colors)
|
6
6
|
format = Ppl::Format::AddressBook::Names.new(colors)
|
7
7
|
end
|
8
8
|
end
|
@@ -25,7 +25,7 @@ describe Ppl::Format::AddressBook::Names do
|
|
25
25
|
describe "#process" do
|
26
26
|
|
27
27
|
it "should at least show the contact's id" do
|
28
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
29
29
|
:id => "test:",
|
30
30
|
:name => nil,
|
31
31
|
})
|
@@ -34,7 +34,7 @@ describe Ppl::Format::AddressBook::Names do
|
|
34
34
|
|
35
35
|
it "should show the name if it's available" do
|
36
36
|
@contact.name = "John Doe"
|
37
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
38
38
|
:id => "test:",
|
39
39
|
:name => "John Doe",
|
40
40
|
})
|
@@ -2,7 +2,7 @@ describe Ppl::Format::AddressBook::Nicknames do
|
|
2
2
|
describe "#initialize" do
|
3
3
|
it "should pass the colors through to the table" do
|
4
4
|
colors = {"id" => "blue"}
|
5
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :nicknames], colors)
|
6
6
|
format = Ppl::Format::AddressBook::Nicknames.new(colors)
|
7
7
|
end
|
8
8
|
end
|
@@ -25,7 +25,7 @@ describe Ppl::Format::AddressBook::Nicknames do
|
|
25
25
|
describe "#process" do
|
26
26
|
|
27
27
|
it "should at least show the contact's id" do
|
28
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
29
29
|
:id => "test:",
|
30
30
|
:nicknames => "",
|
31
31
|
})
|
@@ -34,7 +34,7 @@ describe Ppl::Format::AddressBook::Nicknames do
|
|
34
34
|
|
35
35
|
it "should show a nickname if it's available" do
|
36
36
|
@contact.nicknames.push("Stupid")
|
37
|
-
@table.
|
37
|
+
expect(@table).to receive(:add_row).with({
|
38
38
|
:id => "test:",
|
39
39
|
:nicknames => "Stupid",
|
40
40
|
})
|
@@ -45,7 +45,7 @@ describe Ppl::Format::AddressBook::Nicknames do
|
|
45
45
|
|
46
46
|
describe "#disable_colors!" do
|
47
47
|
it "should turn off the table's colors" do
|
48
|
-
@table.
|
48
|
+
expect(@table).to receive(:disable_colors!)
|
49
49
|
@format.disable_colors!
|
50
50
|
end
|
51
51
|
end
|
@@ -2,7 +2,7 @@ describe Ppl::Format::AddressBook::OneLine do
|
|
2
2
|
describe "#initialize" do
|
3
3
|
it "should pass the colors through to the table" do
|
4
4
|
colors = {"id" => "blue"}
|
5
|
-
Ppl::Format::Table.
|
5
|
+
expect(Ppl::Format::Table).to receive(:new).with([:id, :name, :email], colors)
|
6
6
|
format = Ppl::Format::AddressBook::OneLine.new(colors)
|
7
7
|
end
|
8
8
|
end
|
@@ -25,7 +25,7 @@ describe Ppl::Format::AddressBook::OneLine do
|
|
25
25
|
describe "#process" do
|
26
26
|
|
27
27
|
it "should at least show the contact's id" do
|
28
|
-
@table.
|
28
|
+
expect(@table).to receive(:add_row).with({
|
29
29
|
:id => "test:",
|
30
30
|
:name => nil,
|
31
31
|
:email => nil,
|
@@ -36,7 +36,7 @@ describe Ppl::Format::AddressBook::OneLine do
|
|
36
36
|
it "should show all the info if it's available" do
|
37
37
|
@contact.name = "John Doe"
|
38
38
|
@contact.email_addresses << Ppl::Entity::EmailAddress.new("jdoe@example.org")
|
39
|
-
@table.
|
39
|
+
expect(@table).to receive(:add_row).with({
|
40
40
|
:id => "test:",
|
41
41
|
:name => "John Doe",
|
42
42
|
:email => "<jdoe@example.org>",
|
@@ -48,8 +48,8 @@ describe Ppl::Format::AddressBook::OneLine do
|
|
48
48
|
@contact.email_addresses << Ppl::Entity::EmailAddress.new("jdoe@example.org")
|
49
49
|
@contact.email_addresses << Ppl::Entity::EmailAddress.new("fred@testtest.es")
|
50
50
|
@contact.email_addresses[1].preferred = true
|
51
|
-
@table.
|
52
|
-
row[:email].
|
51
|
+
expect(@table).to receive(:add_row) do |row|
|
52
|
+
expect(row[:email]).to eq "<fred@testtest.es>"
|
53
53
|
end
|
54
54
|
@format.process(@address_book)
|
55
55
|
end
|