From 78812cab82f5d71c0fc901cbc15a99c124422abe Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Sat, 18 Apr 2015 17:31:42 -0400 Subject: [PATCH 01/13] Added test target with pods. Setup basic tests. --- Podfile | 15 ++ SWTableViewCell.xcodeproj/project.pbxproj | 214 ++++++++++++++++++++ SWTableViewCell/SWTableViewCell-Info.plist | 2 +- SWTableViewCellTests/Info.plist | 24 +++ SWTableViewCellTests/SWTableViewCellTests.m | 75 +++++++ 5 files changed, 329 insertions(+), 1 deletion(-) create mode 100644 Podfile create mode 100644 SWTableViewCellTests/Info.plist create mode 100644 SWTableViewCellTests/SWTableViewCellTests.m diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..b08b1e5 --- /dev/null +++ b/Podfile @@ -0,0 +1,15 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '6.0' + +target 'SWTableViewCell' do + +end + +target 'SWTableViewCellTests' do + pod 'FBSnapshotTestCase' + pod 'Expecta+Snapshots' + pod 'Specta' + pod 'Expecta' + pod 'OCMock' +end + diff --git a/SWTableViewCell.xcodeproj/project.pbxproj b/SWTableViewCell.xcodeproj/project.pbxproj index 50a61fb..d0841bc 100644 --- a/SWTableViewCell.xcodeproj/project.pbxproj +++ b/SWTableViewCell.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 523AF8131189D5910D9959B7 /* libPods-SWTableViewCellTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92B6FCB0D9F5F5976482C755 /* libPods-SWTableViewCellTests.a */; }; + 76D732681AE2F50200909802 /* SWTableViewCellTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D732671AE2F50200909802 /* SWTableViewCellTests.m */; }; 810308911846579B00C378F0 /* NSMutableArray+SWUtilityButtons.m in Sources */ = {isa = PBXBuildFile; fileRef = 810308861846579B00C378F0 /* NSMutableArray+SWUtilityButtons.m */; }; 810308921846579B00C378F0 /* SWCellScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 810308881846579B00C378F0 /* SWCellScrollView.m */; }; 810308931846579B00C378F0 /* SWLongPressGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8103088A1846579B00C378F0 /* SWLongPressGestureRecognizer.m */; }; @@ -33,7 +35,21 @@ AFF15D1717F35E46007F5746 /* MI.png in Resources */ = {isa = PBXBuildFile; fileRef = AFF15D1617F35E46007F5746 /* MI.png */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 76D732691AE2F50200909802 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = AF34B75D17DEE2AE00BD9082 /* Project object */; + proxyType = 1; + remoteGlobalIDString = AF34B76417DEE2B100BD9082; + remoteInfo = SWTableViewCell; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ + 561A417CAF3000B9397EB62B /* Pods-SWTableViewCellTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SWTableViewCellTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SWTableViewCellTests/Pods-SWTableViewCellTests.debug.xcconfig"; sourceTree = ""; }; + 76D732631AE2F50100909802 /* SWTableViewCellTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SWTableViewCellTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 76D732661AE2F50200909802 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 76D732671AE2F50200909802 /* SWTableViewCellTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWTableViewCellTests.m; sourceTree = ""; }; 810308851846579B00C378F0 /* NSMutableArray+SWUtilityButtons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+SWUtilityButtons.h"; sourceTree = ""; }; 810308861846579B00C378F0 /* NSMutableArray+SWUtilityButtons.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+SWUtilityButtons.m"; sourceTree = ""; }; 810308871846579B00C378F0 /* SWCellScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWCellScrollView.h; sourceTree = ""; }; @@ -49,6 +65,7 @@ 810308A1184D682700C378F0 /* um.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = um.png; sourceTree = ""; }; 810308A3184D688D00C378F0 /* UMTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UMTableViewCell.h; sourceTree = ""; }; 810308A4184D688D00C378F0 /* UMTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UMTableViewCell.m; sourceTree = ""; }; + 92B6FCB0D9F5F5976482C755 /* libPods-SWTableViewCellTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SWTableViewCellTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; AF28B0F017F77DA300A77ABB /* clock@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "clock@2x.png"; sourceTree = ""; }; AF28B0F217F77DA600A77ABB /* cross@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "cross@2x.png"; sourceTree = ""; }; AF28B0F417F77DB000A77ABB /* check@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "check@2x.png"; sourceTree = ""; }; @@ -71,9 +88,18 @@ AF34B78317DEE2B800BD9082 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; AF34B78417DEE2B800BD9082 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; AFF15D1617F35E46007F5746 /* MI.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MI.png; sourceTree = ""; }; + E9AD27C1AFAEBD8EA1DEF5A5 /* Pods-SWTableViewCellTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SWTableViewCellTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SWTableViewCellTests/Pods-SWTableViewCellTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 76D732601AE2F50100909802 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 523AF8131189D5910D9959B7 /* libPods-SWTableViewCellTests.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; AF34B76217DEE2B100BD9082 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -87,6 +113,32 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 55277640D2AABB814E20D3F5 /* Pods */ = { + isa = PBXGroup; + children = ( + 561A417CAF3000B9397EB62B /* Pods-SWTableViewCellTests.debug.xcconfig */, + E9AD27C1AFAEBD8EA1DEF5A5 /* Pods-SWTableViewCellTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 76D732641AE2F50100909802 /* SWTableViewCellTests */ = { + isa = PBXGroup; + children = ( + 76D732671AE2F50200909802 /* SWTableViewCellTests.m */, + 76D732651AE2F50200909802 /* Supporting Files */, + ); + path = SWTableViewCellTests; + sourceTree = ""; + }; + 76D732651AE2F50200909802 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 76D732661AE2F50200909802 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; 810308841846579B00C378F0 /* PodFiles */ = { isa = PBXGroup; children = ( @@ -110,8 +162,10 @@ isa = PBXGroup; children = ( AF34B76E17DEE2B200BD9082 /* SWTableViewCell */, + 76D732641AE2F50100909802 /* SWTableViewCellTests */, AF34B76717DEE2B200BD9082 /* Frameworks */, AF34B76617DEE2B200BD9082 /* Products */, + 55277640D2AABB814E20D3F5 /* Pods */, ); sourceTree = ""; }; @@ -119,6 +173,7 @@ isa = PBXGroup; children = ( AF34B76517DEE2B200BD9082 /* SWTableViewCell.app */, + 76D732631AE2F50100909802 /* SWTableViewCellTests.xctest */, ); name = Products; sourceTree = ""; @@ -130,6 +185,7 @@ AF34B76817DEE2B200BD9082 /* UIKit.framework */, AF34B76A17DEE2B200BD9082 /* Foundation.framework */, AF34B76C17DEE2B200BD9082 /* CoreGraphics.framework */, + 92B6FCB0D9F5F5976482C755 /* libPods-SWTableViewCellTests.a */, ); name = Frameworks; sourceTree = ""; @@ -173,6 +229,26 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 76D732621AE2F50100909802 /* SWTableViewCellTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 76D7326B1AE2F50200909802 /* Build configuration list for PBXNativeTarget "SWTableViewCellTests" */; + buildPhases = ( + C67FB53E1CB021D85E035F1B /* Check Pods Manifest.lock */, + 76D7325F1AE2F50100909802 /* Sources */, + 76D732601AE2F50100909802 /* Frameworks */, + 76D732611AE2F50100909802 /* Resources */, + BE30338A7FDC2C4BE8F57ADB /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + 76D7326A1AE2F50200909802 /* PBXTargetDependency */, + ); + name = SWTableViewCellTests; + productName = SWTableViewCellTests; + productReference = 76D732631AE2F50100909802 /* SWTableViewCellTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; AF34B76417DEE2B100BD9082 /* SWTableViewCell */ = { isa = PBXNativeTarget; buildConfigurationList = AF34B78817DEE2B900BD9082 /* Build configuration list for PBXNativeTarget "SWTableViewCell" */; @@ -199,6 +275,10 @@ LastUpgradeCheck = 0460; ORGANIZATIONNAME = "Chris Wendel"; TargetAttributes = { + 76D732621AE2F50100909802 = { + CreatedOnToolsVersion = 6.3; + TestTargetID = AF34B76417DEE2B100BD9082; + }; AF34B76417DEE2B100BD9082 = { DevelopmentTeam = CRQMUWXT26; }; @@ -217,11 +297,19 @@ projectRoot = ""; targets = ( AF34B76417DEE2B100BD9082 /* SWTableViewCell */, + 76D732621AE2F50100909802 /* SWTableViewCellTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 76D732611AE2F50100909802 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; AF34B76317DEE2B100BD9082 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -242,7 +330,48 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + BE30338A7FDC2C4BE8F57ADB /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SWTableViewCellTests/Pods-SWTableViewCellTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + C67FB53E1CB021D85E035F1B /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ + 76D7325F1AE2F50100909802 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 76D732681AE2F50200909802 /* SWTableViewCellTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; AF34B76117DEE2B100BD9082 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -262,6 +391,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 76D7326A1AE2F50200909802 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = AF34B76417DEE2B100BD9082 /* SWTableViewCell */; + targetProxy = 76D732691AE2F50200909802 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ AF34B77117DEE2B400BD9082 /* InfoPlist.strings */ = { isa = PBXVariantGroup; @@ -282,6 +419,74 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 76D7326C1AE2F50200909802 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 561A417CAF3000B9397EB62B /* Pods-SWTableViewCellTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = SWTableViewCellTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SWTableViewCell.app/SWTableViewCell"; + }; + name = Debug; + }; + 76D7326D1AE2F50200909802 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E9AD27C1AFAEBD8EA1DEF5A5 /* Pods-SWTableViewCellTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = SWTableViewCellTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SWTableViewCell.app/SWTableViewCell"; + }; + name = Release; + }; AF34B78617DEE2B800BD9082 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -371,6 +576,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 76D7326B1AE2F50200909802 /* Build configuration list for PBXNativeTarget "SWTableViewCellTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 76D7326C1AE2F50200909802 /* Debug */, + 76D7326D1AE2F50200909802 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; AF34B76017DEE2AE00BD9082 /* Build configuration list for PBXProject "SWTableViewCell" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/SWTableViewCell/SWTableViewCell-Info.plist b/SWTableViewCell/SWTableViewCell-Info.plist index 2f1980e..63cbdc3 100644 --- a/SWTableViewCell/SWTableViewCell-Info.plist +++ b/SWTableViewCell/SWTableViewCell-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.ChrisWendel.${PRODUCT_NAME:rfc1034identifier} + com.ChrisWendel.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/SWTableViewCellTests/Info.plist b/SWTableViewCellTests/Info.plist new file mode 100644 index 0000000..5870662 --- /dev/null +++ b/SWTableViewCellTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.ChrisWendel.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/SWTableViewCellTests/SWTableViewCellTests.m b/SWTableViewCellTests/SWTableViewCellTests.m new file mode 100644 index 0000000..a530928 --- /dev/null +++ b/SWTableViewCellTests/SWTableViewCellTests.m @@ -0,0 +1,75 @@ +#import +#import +#import +#import +#import +#import "SWTableViewCell.h" + +SpecBegin(SWTableViewCell) + +__block NSArray *rightButtons; +__block NSArray *leftButtons; + +before(^{ + NSMutableArray *rightUtilityButtons = [NSMutableArray new]; + [rightUtilityButtons sw_addUtilityButtonWithColor: + [UIColor colorWithRed:0.78f green:0.78f blue:0.8f alpha:1.0] + title:@"More"]; + [rightUtilityButtons sw_addUtilityButtonWithColor: + [UIColor colorWithRed:1.0f green:0.231f blue:0.188 alpha:1.0f] + title:@"Delete"]; + + rightButtons = rightUtilityButtons; + + + NSMutableArray *leftUtilityButtons = [NSMutableArray new]; + + [leftUtilityButtons sw_addUtilityButtonWithColor: + [UIColor colorWithRed:0.07 green:0.75f blue:0.16f alpha:1.0] + icon:[UIImage imageNamed:@"check.png"]]; + [leftUtilityButtons sw_addUtilityButtonWithColor: + [UIColor colorWithRed:1.0f green:1.0f blue:0.35f alpha:1.0] + icon:[UIImage imageNamed:@"clock.png"]]; + [leftUtilityButtons sw_addUtilityButtonWithColor: + [UIColor colorWithRed:1.0f green:0.231f blue:0.188f alpha:1.0] + icon:[UIImage imageNamed:@"cross.png"]]; + [leftUtilityButtons sw_addUtilityButtonWithColor: + [UIColor colorWithRed:0.55f green:0.27f blue:0.07f alpha:1.0] + icon:[UIImage imageNamed:@"list.png"]]; + + leftButtons = leftButtons; + +}); + +describe(@"init", ^{ + it(@"should init with cell style UITableViewStyleDefault", ^{ + SWTableViewCell *cell = [[SWTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; + expect(cell).toNot.beNil; + }); + + it(@"should init with cell style UITableViewStyleSubtitle", ^{ + SWTableViewCell *cell = [[SWTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nil]; + expect(cell).toNot.beNil; + }); +}); + +describe(@"buttons", ^{ + __block SWTableViewCell *cell; + + before(^{ + cell = [[SWTableViewCell alloc] init]; + [cell setRightUtilityButtons:rightButtons WithButtonWidth:44.0f]; + [cell setLeftUtilityButtons:leftButtons WithButtonWidth:44.0f]; + }); + + it(@"should have two right buttons", ^{ + expect(cell.rightUtilityButtons.count).to.equal(2); + }); + + it(@"should have four left buttons", ^{ + expect(cell.leftUtilityButtons.count).to.equal(4); + }); +}); + + +SpecEnd \ No newline at end of file From a100d30a1315771a735c516b0028bc371b47e972 Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Sat, 18 Apr 2015 17:53:07 -0400 Subject: [PATCH 02/13] added travis integration --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cfd98d2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: objective-c +before_install: + - export LANG=en_US.UTF-8 + - gem install cocoapods xcpretty --no-ri --no-rdoc + - pod install + +script: + - set -o pipefail && xcodebuild test -workspace SWTableViewCell.xcworkspace -scheme SWTableViewCell -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c \ No newline at end of file From d1e84332d93658f14ecee7fe62206b7bf7742fb4 Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Sat, 18 Apr 2015 18:09:44 -0400 Subject: [PATCH 03/13] added gitignore for pods added shared scheme for workspace --- .gitignore | 3 +- .../xcschemes/SWTableViewCell.xcscheme | 112 ++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 SWTableViewCell.xcodeproj/xcshareddata/xcschemes/SWTableViewCell.xcscheme diff --git a/.gitignore b/.gitignore index d00728a..a3caa2a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ profile *.moved-aside xcuserdata/ project.xcworkspace/ -xcshareddata/ \ No newline at end of file +Podfile.lock +Pods diff --git a/SWTableViewCell.xcodeproj/xcshareddata/xcschemes/SWTableViewCell.xcscheme b/SWTableViewCell.xcodeproj/xcshareddata/xcschemes/SWTableViewCell.xcscheme new file mode 100644 index 0000000..9692a5b --- /dev/null +++ b/SWTableViewCell.xcodeproj/xcshareddata/xcschemes/SWTableViewCell.xcscheme @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 98e397050cf370ef4912fe5f7c84c365f8eb2d01 Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Sat, 18 Apr 2015 18:22:36 -0400 Subject: [PATCH 04/13] Updated travis config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cfd98d2..5038358 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,4 @@ before_install: - pod install script: - - set -o pipefail && xcodebuild test -workspace SWTableViewCell.xcworkspace -scheme SWTableViewCell -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c \ No newline at end of file + - xcodebuild test -workspace SWTableViewCell.xcworkspace -scheme SWTableViewCell -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO \ No newline at end of file From 8745d3a21e2951026aa4d6447ec6a4af35009d7d Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Sat, 18 Apr 2015 18:30:33 -0400 Subject: [PATCH 05/13] fixed broken test --- SWTableViewCellTests/SWTableViewCellTests.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SWTableViewCellTests/SWTableViewCellTests.m b/SWTableViewCellTests/SWTableViewCellTests.m index a530928..951eb8d 100644 --- a/SWTableViewCellTests/SWTableViewCellTests.m +++ b/SWTableViewCellTests/SWTableViewCellTests.m @@ -37,7 +37,7 @@ [UIColor colorWithRed:0.55f green:0.27f blue:0.07f alpha:1.0] icon:[UIImage imageNamed:@"list.png"]]; - leftButtons = leftButtons; + leftButtons = leftUtilityButtons; }); From 61d0a666f4c9f252a92368a1e9fa3566069345a7 Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Sat, 18 Apr 2015 18:32:27 -0400 Subject: [PATCH 06/13] reset travis config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5038358..cfd98d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,4 @@ before_install: - pod install script: - - xcodebuild test -workspace SWTableViewCell.xcworkspace -scheme SWTableViewCell -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO \ No newline at end of file + - set -o pipefail && xcodebuild test -workspace SWTableViewCell.xcworkspace -scheme SWTableViewCell -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c \ No newline at end of file From 3bc07a0cbd569b17aeaecd7d738043fd4fc02c66 Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Sat, 18 Apr 2015 18:44:16 -0400 Subject: [PATCH 07/13] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index acccd4a..d6102de 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ SWTableViewCell =============== +[![Build Status](https://travis-ci.org/addoshi/SWTableViewCell.svg?branch=master)](https://travis-ci.org/addoshi/SWTableViewCell) +

An easy-to-use UITableViewCell subclass that implements a swipeable content view which exposes utility buttons (similar to iOS 7 Mail Application) From d45bd8cde8b42ac52a9301d64303c4fdfe4d883e Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Fri, 24 Apr 2015 12:46:52 -0400 Subject: [PATCH 08/13] add coveralls (test coverage) support --- .slather.yml | 4 ++++ .travis.yml | 4 +++- SWTableViewCell.xcodeproj/project.pbxproj | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .slather.yml diff --git a/.slather.yml b/.slather.yml new file mode 100644 index 0000000..8fd8df3 --- /dev/null +++ b/.slather.yml @@ -0,0 +1,4 @@ +ci_service: travis_ci +coverage_service: coveralls +xcodeproj: SWTableViewCell.xcodeproj +source_directory: SWTableViewCell diff --git a/.travis.yml b/.travis.yml index cfd98d2..c7807a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,6 @@ before_install: - pod install script: - - set -o pipefail && xcodebuild test -workspace SWTableViewCell.xcworkspace -scheme SWTableViewCell -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c \ No newline at end of file + - set -o pipefail && xcodebuild test -workspace SWTableViewCell.xcworkspace -scheme SWTableViewCell -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c + +after_success: slather diff --git a/SWTableViewCell.xcodeproj/project.pbxproj b/SWTableViewCell.xcodeproj/project.pbxproj index d0841bc..49fc8ed 100644 --- a/SWTableViewCell.xcodeproj/project.pbxproj +++ b/SWTableViewCell.xcodeproj/project.pbxproj @@ -435,6 +435,8 @@ "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", ); + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -472,6 +474,8 @@ "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", ); + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; From 6c4a7c6ef5f6307063650ed941a4c629317da550 Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Fri, 24 Apr 2015 12:57:32 -0400 Subject: [PATCH 09/13] add slather gem to travis config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c7807a9..87b7c40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: objective-c before_install: - export LANG=en_US.UTF-8 - - gem install cocoapods xcpretty --no-ri --no-rdoc + - gem install cocoapods xcpretty slather -N - pod install script: From 52046dad3d81ffc28d3ecfe89cd395d599c26dcf Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Fri, 24 Apr 2015 13:10:49 -0400 Subject: [PATCH 10/13] Add coveralls badge to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d6102de..d8c0a57 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ SWTableViewCell =============== [![Build Status](https://travis-ci.org/addoshi/SWTableViewCell.svg?branch=master)](https://travis-ci.org/addoshi/SWTableViewCell) +[![Coverage Status](https://coveralls.io/repos/addoshi/SWTableViewCell/badge.svg)](https://coveralls.io/r/addoshi/SWTableViewCell)

From 6054de0641c2f69b095ef77a7d9fde1d8a5d3ea7 Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Fri, 24 Apr 2015 13:44:28 -0400 Subject: [PATCH 11/13] add flags to generate coverage files --- SWTableViewCell.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SWTableViewCell.xcodeproj/project.pbxproj b/SWTableViewCell.xcodeproj/project.pbxproj index 49fc8ed..138d367 100644 --- a/SWTableViewCell.xcodeproj/project.pbxproj +++ b/SWTableViewCell.xcodeproj/project.pbxproj @@ -435,8 +435,6 @@ "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", ); - GCC_GENERATE_TEST_COVERAGE_FILES = YES; - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -474,8 +472,6 @@ "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", ); - GCC_GENERATE_TEST_COVERAGE_FILES = YES; - GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -507,6 +503,8 @@ COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -537,6 +535,8 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; From f1300b445891e345546b74c5705a344c90d8f659 Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Fri, 24 Apr 2015 13:58:16 -0400 Subject: [PATCH 12/13] Update source directory to test coverage --- .slather.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.slather.yml b/.slather.yml index 8fd8df3..f624708 100644 --- a/.slather.yml +++ b/.slather.yml @@ -1,4 +1,4 @@ ci_service: travis_ci coverage_service: coveralls xcodeproj: SWTableViewCell.xcodeproj -source_directory: SWTableViewCell +source_directory: SWTableViewCell/PodFiles From 1894c18bd8d83d617f2443fe3bda48125feac88b Mon Sep 17 00:00:00 2001 From: Anup Doshi Date: Fri, 1 May 2015 00:29:42 -0400 Subject: [PATCH 13/13] update travis config --- .travis.yml | 12 ++++++------ SWTableViewCellTests/SWTableViewCellTests.m | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87b7c40..8a35574 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: objective-c +cache: cocoapods +xcode_workspace: SWTableViewCell.xcworkspace +xcode_scheme: SWTableViewCell +xcode_sdk: iphonesimulator + before_install: - - export LANG=en_US.UTF-8 - - gem install cocoapods xcpretty slather -N - - pod install - -script: - - set -o pipefail && xcodebuild test -workspace SWTableViewCell.xcworkspace -scheme SWTableViewCell -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c + - gem install cocoapods slather -N after_success: slather diff --git a/SWTableViewCellTests/SWTableViewCellTests.m b/SWTableViewCellTests/SWTableViewCellTests.m index 951eb8d..0d2e8f9 100644 --- a/SWTableViewCellTests/SWTableViewCellTests.m +++ b/SWTableViewCellTests/SWTableViewCellTests.m @@ -57,7 +57,7 @@ __block SWTableViewCell *cell; before(^{ - cell = [[SWTableViewCell alloc] init]; + cell = [[SWTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; [cell setRightUtilityButtons:rightButtons WithButtonWidth:44.0f]; [cell setLeftUtilityButtons:leftButtons WithButtonWidth:44.0f]; });