Skip to content

Instantly share code, notes, and snippets.

View sgleadow's full-sized avatar

Stewart Gleadow sgleadow

View GitHub Profile
@sgleadow
sgleadow / Rakefile
Created September 14, 2017 21:07
Ruby script to ensure an Xcode project has no build settings configure
require 'bundler'
Bundler.require
desc "Check there are no build settings in the project file"
task :check_settings do
projects = Dir.glob('*.xcodeproj').map do |project_file|
Xcodeproj::Project.open(project_file)
end
projects.each do |project|
@sgleadow
sgleadow / check_no_xcode_build_settings.sh
Created September 14, 2017 21:04
Shell script to ensure Xcode project file is clean of build settings
#!/bin/sh
#
# Check that there are no overridden build settings in Xcode
# This is hacky, if I could work out how to parse the project file I'd do it better
# - SG
for PROJECT in *.xcodeproj; do
PROJECT_FILE_PATH=$PROJECT/project.pbxproj
@sgleadow
sgleadow / gist:4034956
Created November 7, 2012 22:30
Stub and mock class methods using Kiwi
Testing that the mocks and stubs in Kiwi work correctly for class methods
@sgleadow
sgleadow / gist:4029858
Created November 7, 2012 06:33
Example of stubbing and mocking class methods using Kiwi
#import "Kiwi.h"
@interface MyFactory : NSObject
+ (id)makeThingsCalled:(NSString *)name;
@end
@implementation MyFactory
+ (id)makeThingsCalled:(NSString *)name;
{
@sgleadow
sgleadow / RunPlatformUnitTests.sh
Created April 18, 2012 03:11
Modified shell script to run OCUnit and Kiwi tests on the command line.
#!/bin/sh
##
# Copyright 2008 Apple Inc.
# All rights reserved.
#
# iPhoneSimulator platform
# This script runs all of the unit tests for the target test bundle specified by the passed-in environment.
# This script is generally intended to be invoked by ${DEVELOPER_TOOLS_DIR}/RunUnitTests. The interface or location of this script may change in future releases.
##
#