You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/test_helper.rb
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,4 +14,13 @@ def teardown
14
14
clear_output
15
15
end
16
16
17
-
end
17
+
defassert_directory_contains(dir,files)
18
+
files_in_directory=Dir["#{dir}/*"]
19
+
iffiles.kind_of?(Array)
20
+
assertfiles_in_directory.length == files.length,"Expected directory to contain exactly #{files.length} files"
21
+
else
22
+
files=[files]
23
+
end
24
+
files.each{ |f| assertfiles_in_directory.include?(File.join(dir,f)),"Expected directory #{dir} to contain file #{f}, but it contains #{files_in_directory.inspect}"}
Docsplit.extract_images('test/fixtures/PDF file with spaces \'single\' and "double quotes".pdf',:format=>:gif,:size=>"250x",:output=>OUTPUT)
46
-
assertDir["#{OUTPUT}/*"] == ['test/output/PDF file with spaces \'single\' and "double quotes"_1.gif','test/output/PDF file with spaces \'single\' and "double quotes"_2.gif']
46
+
assert_directory_contains(OUTPUT,['PDF file with spaces \'single\' and "double quotes"_1.gif',
47
+
'PDF file with spaces \'single\' and "double quotes"_1.gif'])
0 commit comments