forked from railsakademi/odev-01ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.rb
More file actions
27 lines (24 loc) · 735 Bytes
/
Copy pathtest.rb
File metadata and controls
27 lines (24 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require 'minitest'
require 'minitest/autorun'
require './address_book.rb'
require './person.rb'
class TestAddressBook < Minitest::Test
def setup
@address_book = AddressBook.new("people.csv")
end
def test_print_people
out, err = capture_subprocess_io do
@address_book.print_people
end
assert_match /Roy Clark/, out
assert_match /Diana Sullivan/, out
assert_match /16\,Bonnie Adams\,54-\(568\)416-0730\,Las Varillas/, out
assert_match /6\,Clarence Dunn\,46-\(639\)894-1792\,Kista/, out
end
def test_search_people
out, err = capture_subprocess_io do
@address_book.search_person("Jean")
end
assert_match /3,Jean Richardson,351-\(187\)631-6728,Casais Brancos/, out
end
end