Skip to content

Instantly share code, notes, and snippets.

View lukeredpath's full-sized avatar
🏠
Working from home

Luke Redpath lukeredpath

🏠
Working from home
View GitHub Profile
@lukeredpath
lukeredpath / LRPopoverManager.h
Created May 24, 2010 16:28
Singleton popover manager to enforce the one popover at at time rule. MIT license, help yourself
//
// LRPopoverManager.h
// Spark
//
// Created by Luke Redpath on 24/05/2010.
// Copyright 2010 LJR Software Limited. All rights reserved.
//
#import <Foundation/Foundation.h>
diff --git a/Rakefile b/Rakefile
index ef81333..69b1a90 100644
--- a/Rakefile
+++ b/Rakefile
@@ -15,8 +15,10 @@ begin
gem.add_dependency "httparty", ">= 0"
gem.add_dependency "nokogiri", ">= 0"
gem.extensions = ['ext/Rakefile']
- gem.files += ['bin/iphonesim']
+
diff --git a/WaxSim.xcodeproj/project.pbxproj b/WaxSim.xcodeproj/project.pbxproj
index e46b134..7d3b79a 100644
--- a/WaxSim.xcodeproj/project.pbxproj
+++ b/WaxSim.xcodeproj/project.pbxproj
@@ -102,7 +102,6 @@
8DD76F990486AA7600D96B5E /* Sources */,
8DD76F9B0486AA7600D96B5E /* Frameworks */,
8DD76F9E0486AA7600D96B5E /* CopyFiles */,
- 0482769511263E2A003DFACB /* ShellScript */,
);
@implementation MockeryTests
- (void)setUp;
{
testCase = [MockTestCase new];
context = [LRMockery mockeryForTestCase:testCase];
}
- (void)testCanExpectSingleMethodCallAndPass;
{
- (void)testMocksCanReturnAnObjectFromAnExpectedInvocation;
{
SimpleObject *testObject = [context mock:[SimpleObject class]];
NSString *expectedObject = @"some string";
[context checking:^(LRExpectationBuilder *that){
[[that oneOf:testObject] returnSomething]; [that will:returnObject(expectedObject)];
}];
@implementation LRInvocationComparitor
+ (id)comparitorForInvocation:(NSInvocation *)invocation;
{
return [[[self alloc] initWithInvocation:invocation] autorelease];
}
- (id)initWithInvocation:(NSInvocation *)anInvocation;
{
if (self = [super init]) {
@lukeredpath
lukeredpath / fetch_finance_reports.rb
Created July 28, 2010 15:00
Fetch iTunes finance reports for your iPhone apps
#!/usr/bin/env ruby
require 'mechanize'
require 'open-uri'
require 'pathname'
require 'fileutils'
require 'pp'
### BEGIN CUSTOMIZATION
# set this to where you would like the reports to be stored
@lukeredpath
lukeredpath / process_finance_report.rb
Created July 28, 2010 15:14
A script for processing iTunes finance reports and importing to FreeAgent
#!/usr/bin/env ruby
### REQUIRED GEMS: restclient, activesupport, crack, mash, money, fastercsv
### USAGE
# fetch_finance_reports finance_report_1 finance_report_2 ... finance_report_x
### BEGIN CUSTOMIZATION
# I like to store this in a separate file in my home folder, ~/.freeagent
- (void)testFailedMockingWithHamcrest
{
LRMockery *context = [LRMockery mockeryForTestCase:self];
id myMockString = [context mock:[NSString class] named:@"My Mock String"];
[context checking:^(that){
[[oneOf(myMockString) receives] stringByAppendingString:with(startsWith(@"super"))];
}];
@lukeredpath
lukeredpath / AssertEventually.h
Created August 3, 2010 13:20
Enables simple and elegant testing of asynchronous/threaded code with OCUnit, blocks and OCHamcrest
//
// AssertEventually.h
// LRResty
//
// Created by Luke Redpath on 03/08/2010.
// Copyright 2010 LJR Software Limited. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "HCMatcher.h"