gali8 / Tesseract-OCR-iOS

Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64.
http://www.nexor.it
MIT License
4.22k stars 949 forks source link

Remove copyFilesFromResources parameter from initializer #171

Closed PatrickNLT closed 9 years ago

PatrickNLT commented 9 years ago

WIP for #170

PatrickNLT commented 9 years ago

There is no test for now for the case when there is no tessdata directory in the application bundle: if anyone knows how to mock this, please comment.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.15%) to 94.8% when pulling b2d017b645d4b25514ff6ae1ba1d342c2135a10e on PatrickNLT:initializer-refactoring into 2cea0daebd5e3515f2fc8475b98e86201e8f4937 on gali8:master.

ws233 commented 9 years ago

Pls, take a look here: https://github.com/kiwi-bdd/Kiwi/wiki/Mocks-and-Stubs

ws233 commented 9 years ago

@PatrickNLT, one more thing. It seems that there are two instances of very similar code in tests:

  1. copyDataToCustomDirectory and moveTessdataToCachesDirectoryIfNecessary
  2. cleanCustomTessdataFolder and cleanTessdataFolder. Could you take a look carefully on that code and change it so there is no code duplication?
ws233 commented 9 years ago

I've fixed my own concerns in #189. Pls, review.

ws233 commented 9 years ago

There is no test for now for the case when there is no tessdata directory in the application bundle: if anyone knows how to mock this, please comment.

There is a case in InitializationTests.m at line 358, which does exactly what is requested.

    it(@"Should return nil if contentsOfDirectoryAtPath fails", ^{
        checkInitializationWithFailedSelectorReturnValueAndCount(@selector(contentsOfDirectoryAtPath:error:), nil, 2);
        cleanTessdataFolderAtPath(cachesTessDataPath);
    });

So it seems the issue can be closed, if there is no more concerns about it, @kevincon.