Skip to content

Commit ca2af63

Browse files
committed
Somtimes the key is the empty string
1 parent 7906e9d commit ca2af63

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

api-spec-testing/rspec_matchers.rb

+2
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ def compare_hash(expected_pairs, actual_hash, test)
194194
test.get_cached_value(k)
195195
end
196196
actual_value = TestFile::Test.find_value_in_document(split_key, actual_hash)
197+
# When the expected_key is ''
198+
actual_value = actual_hash if split_key.empty?
197199
# Sometimes the key includes dots. See watcher/put_watch/60_put_watch_with_action_condition.yml
198200
actual_value = TestFile::Test.find_value_in_document(expected_key, actual_hash) if actual_value.nil?
199201

0 commit comments

Comments
 (0)