From 2508a055896ff77be1517f895aba561850b49445 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Thu, 29 Oct 2015 18:22:27 +0800 Subject: [PATCH] Try to create tmp dir, if not exists. --- .gitignore | 2 +- spec/ocr_spec.rb | 2 +- spec/spec_helper.rb | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f80b5fd..ce0e20c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ /spec/reports/ /test/tmp/ /test/version_tmp/ -/tmp/ +!/tmp/ .DS_Store ## Specific to RubyMotion: diff --git a/spec/ocr_spec.rb b/spec/ocr_spec.rb index 69a556f..d85a963 100644 --- a/spec/ocr_spec.rb +++ b/spec/ocr_spec.rb @@ -29,6 +29,6 @@ describe 'OCR' do expect(chars).not_to eq(str) end - puts %(------------------------\nOCR all results: \n#{results.join("\n")}) + puts %(\n------------------------\nOCR all results: \n#{results.join("\n")}) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 80d706c..8eaa0d4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,6 +6,11 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'rucaptcha' require 'rtesseract' +tmp_path = File.join(File.dirname(__FILE__), '../tmp') +if !File.exists?(tmp_path) + Dir.mkdir(tmp_path) +end + RuCaptcha.configure do self.len = 2 self.width = 123