File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ def test_first_address_extraction
7
7
each_test_data do |test_data |
8
8
address = AddressExtractor . first_address ( test_data [ :input ] )
9
9
flunk "No address found in:\n #{ test_data [ :input ] } " if address . nil?
10
- assert_equal_hashes address , test_data [ :expected_output ] . first
10
+ assert_equal_hashes test_data [ :expected_output ] . first , address
11
11
end
12
12
end
13
13
@@ -16,14 +16,14 @@ def test_find_addresses
16
16
addresses = AddressExtractor . find_addresses ( test_data [ :input ] )
17
17
assert_equal addresses . size , test_data [ :expected_output ] . size
18
18
test_data [ :expected_output ] . each do |expected_output |
19
- assert_equal_hashes addresses . shift , expected_output
19
+ assert_equal_hashes expected_output , addresses . shift
20
20
end
21
21
end
22
22
end
23
23
24
24
def test_replace_first_address
25
25
string = AddressExtractor . replace_first_address ( test_data . first [ :input ] ) do |address_hash , address |
26
- assert_equal_hashes address_hash , test_data . first [ :expected_output ] . first
26
+ assert_equal_hashes test_data . first [ :expected_output ] . first , address_hash
27
27
assert_match /^\s *123 Foo St., Someplace FL\s */ , address
28
28
"skidoosh"
29
29
end
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ def test_data
17
17
end
18
18
19
19
module Helpers
20
- def assert_equal_hashes ( a , b )
21
- ( a . keys + b . keys ) . uniq . each do |k |
22
- assert_equal a [ k ] , b [ k ] , "a [#{ k . inspect } ] = #{ a [ k ] . inspect } != b [#{ k . inspect } ] = #{ b [ k ] . inspect } "
20
+ def assert_equal_hashes ( expected , hash )
21
+ ( expected . keys + hash . keys ) . uniq . each do |k |
22
+ assert_equal expected [ k ] , hash [ k ] , "expected [#{ k . inspect } ] = #{ expected [ k ] . inspect } != hash [#{ k . inspect } ] = #{ hash [ k ] . inspect } "
23
23
end
24
24
end
25
25
end
You can’t perform that action at this time.
0 commit comments