diff --git a/Text Reader.xcodeproj/project.pbxproj b/Text Reader.xcodeproj/project.pbxproj index a595a7f..d80b944 100644 --- a/Text Reader.xcodeproj/project.pbxproj +++ b/Text Reader.xcodeproj/project.pbxproj @@ -43,7 +43,6 @@ 4AA884DB17C4559D000A4764 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A2F7544169CD98000DD7A03 /* UIKit.framework */; }; 4AA884DC17C4559D000A4764 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A2F7546169CD98000DD7A03 /* Foundation.framework */; }; 4AA884E217C4559D000A4764 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4AA884E017C4559D000A4764 /* InfoPlist.strings */; }; - 4AA884F817C456BE000A4764 /* SGBookTestst.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AA884F717C456BE000A4764 /* SGBookTestst.m */; }; 4AA8850517C45C40000A4764 /* SGCollection.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ADAF69516ED5A0500123D2B /* SGCollection.m */; }; 4AA8850617C45C44000A4764 /* SGDrawingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A06B74616B62D410023767F /* SGDrawingView.m */; }; 4AA8850717C47DC5000A4764 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A04D64716EA75E400FA0440 /* QuartzCore.framework */; }; @@ -115,7 +114,6 @@ 4AA884DF17C4559D000A4764 /* TextReaderUnitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TextReaderUnitTests-Info.plist"; sourceTree = ""; }; 4AA884E117C4559D000A4764 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 4AA884E617C4559D000A4764 /* TextReaderUnitTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TextReaderUnitTests-Prefix.pch"; sourceTree = ""; }; - 4AA884F717C456BE000A4764 /* SGBookTestst.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGBookTestst.m; sourceTree = ""; }; 4AAE4DE1181B5AEE00868332 /* SGDocumentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGDocumentController.h; sourceTree = ""; }; 4AAE4DE2181B5AEE00868332 /* SGDocumentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGDocumentController.m; sourceTree = ""; }; 4AAE4DE4181B623C00868332 /* SGDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGDocument.h; sourceTree = ""; }; @@ -321,7 +319,6 @@ 4AA884DD17C4559D000A4764 /* TextReaderUnitTests */ = { isa = PBXGroup; children = ( - 4AA884F717C456BE000A4764 /* SGBookTestst.m */, 4AA884DE17C4559D000A4764 /* Supporting Files */, ); path = TextReaderUnitTests; @@ -621,7 +618,6 @@ buildActionMask = 2147483647; files = ( 4A01421D17F5312F00DB315E /* SGLineDrawing.m in Sources */, - 4AA884F817C456BE000A4764 /* SGBookTestst.m in Sources */, 4AA8850517C45C40000A4764 /* SGCollection.m in Sources */, 4AA8850617C45C44000A4764 /* SGDrawingView.m in Sources */, 4AFED93417E15E58007E6209 /* SGAddCollectionController.m in Sources */, diff --git a/Text Reader/Text Reader-Info.plist b/Text Reader/Text Reader-Info.plist index d62345a..5aff793 100644 --- a/Text Reader/Text Reader-Info.plist +++ b/Text Reader/Text Reader-Info.plist @@ -45,7 +45,7 @@ CFBundleVersion - 325 + 327 LSRequiresIPhoneOS UIAppFonts diff --git a/TextReaderUnitTests/SGBookTestst.m b/TextReaderUnitTests/SGBookTestst.m deleted file mode 100644 index c0be30b..0000000 --- a/TextReaderUnitTests/SGBookTestst.m +++ /dev/null @@ -1,111 +0,0 @@ -// -// SYNCollectionTests.m -// Text Reader -// -// Created by Satyam Ghodasara on 9/11/13. -// Copyright (c) 2013 Satyam Ghodasara. All rights reserved. -// - -#import "Kiwi.h" -#import "SGCollection.h" - -SPEC_BEGIN(SYNCollectionTests) - -describe(@"A collection", ^{ - - __block SGCollection *collection; - - beforeEach(^{ - collection = [[SGCollection alloc] initWithTitle:@"Collection"]; - }); - - afterEach(^{ - NSString *documentsDirectory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]; - NSString *CollectionPath = [documentsDirectory stringByAppendingPathComponent:collection.title]; - [[NSFileManager defaultManager] removeItemAtPath:CollectionPath error:nil]; - - collection = nil; - }); - - context(@"on init", ^{ - - it(@"should accept and set a title", ^{ - [[[collection title] should] equal:@"Collection"]; - }); - - it(@"should setup its pages", ^{ - [[[collection pages] should] beNonNil]; - [[[collection pages] should] beKindOfClass:[NSMutableArray class]]; - }); - - it(@"should create a folder with the collection title", ^{ - NSString *documentsDirectory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]; - NSString *CollectionPath = [documentsDirectory stringByAppendingPathComponent:collection.title]; - BOOL isDir; - BOOL CollectionPathExists = [[NSFileManager defaultManager] fileExistsAtPath:CollectionPath isDirectory:&isDir]; - [[theValue(CollectionPathExists) should] equal:theValue(true)]; - [[theValue(isDir) should] equal:theValue(true)]; - }); - - it(@"should have a save path that points to its folder", ^{ - NSString *documentsDirectory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]; - NSString *CollectionPath = [documentsDirectory stringByAppendingPathComponent:collection.title]; - [[[collection savePath] should] equal:CollectionPath]; - }); - - }); - - context(@"on destroy", ^{ - - it(@"should remove the folder", ^{ - [collection destroy]; - NSString *documentsDirectory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]; - NSString *CollectionPath = [documentsDirectory stringByAppendingPathComponent:collection.title]; - BOOL CollectionPathExists = [[NSFileManager defaultManager] fileExistsAtPath:CollectionPath isDirectory:nil]; - [[theValue(CollectionPathExists) should] equal:theValue(false)]; - }); - - }); - - context(@"on adding a page", ^{ - - __block UIImage *image; - - beforeEach(^{ - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *imagePath = [bundle pathForResource:@"icon" ofType:@"png"]; - image = [UIImage imageWithContentsOfFile:imagePath]; - }); - - afterEach(^{ - image = nil; - }); - - it(@"should be added to the Collection's pages array", ^{ - int numPages = collection.pages.count; - [collection addPage:image]; - [[theValue(collection.pages.count) should] equal:theValue(numPages + 1)]; - [[[collection.pages lastObject] should] equal:image]; - }); - - it(@"should be saved to the Collection's directory", ^{ - NSString *documentsDirectory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]; - NSString *CollectionPath = [documentsDirectory stringByAppendingPathComponent:collection.title]; - int numSavedImagesBefore = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:CollectionPath error:nil].count; - [collection addPage:image]; - int numSavedImagesAfter = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:CollectionPath error:nil].count; - - [[theValue(numSavedImagesAfter) shouldNot] equal:theValue(0)]; - [[theValue(numSavedImagesBefore) should] equal:theValue(numSavedImagesAfter - 1)]; - - BOOL isDir; - BOOL CollectionPathExists = [[NSFileManager defaultManager] fileExistsAtPath:CollectionPath isDirectory:&isDir]; - [[theValue(CollectionPathExists) should] equal:theValue(true)]; - [[theValue(isDir) should] equal:theValue(true)]; - }); - - }); - -}); - -SPEC_END \ No newline at end of file