This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation NSObject (Identity) | |
- (BOOL)LR_isClass | |
{ | |
return [self class] == self; | |
} | |
- (BOOL)LR_isProtocol | |
{ | |
return [self class] == NSClassFromString(@"Protocol"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testCanExpectSingleMethodCallAndPass | |
{ | |
id<SomeProtocol> testObject = [context protocolMock:@protocol(SomeProtocol)]; | |
[context check:^{ | |
[[expectThat(testObject) receives] doSomething]; | |
}]; | |
[testObject doSomething]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>WorkingDirectory</key> | |
<string>/Users/teamcity/TeamCity/buildAgent</string> | |
<key>Debug</key> | |
<false/> | |
<key>Label</key> | |
<string>jetbrains.teamcity.BuildAgent</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"user": { | |
"id": 999, | |
"name": "Joe Bloggs" | |
}, | |
"stream": [ | |
{ | |
"link": { | |
"url": "http://www.example.com", | |
"id": 123 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RKObjectMapping+TransformationMapping.h | |
// OtherScreen | |
// | |
// Created by Luke Redpath on 05/10/2012. | |
// Copyright (c) 2012 Mark Rickert. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <RestKit/RestKit.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we want to map foo_bar -> fooBar, baz_qux -> bazQux | |
[mapping addPropertyMappingsFromArray:@["foo_bar", @"baz_qux"] transformSourceToDestinationKeysUsingBlock:^(NSString *sourceKey) { | |
return [sourceKey someMethodThatTransformsSnakeCaseToCamelCase]; | |
}]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[UILabel appearanceWhenContainedIn:[UITableViewHeaderFooterView class], nil] setFont:<whatever>] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Slow cook 2 lb / 1 KG of boneless pork shoulder on low for at least 8 hours, seasoned with salt and pepper and add half a cup of water. | |
2. Remove pork, drain cooking juices and set aside. Remove skin/fat layer and throw it in the oven on 200 C for half hour until you have crackling! | |
3. Shred pork, return to slow cooker with half the cooking juices, enough to keep it moist. | |
4. Slice one medium onion, fry over medium heat until golden, add to pork. | |
5. Add 1 tbsp of barbecue spice/seasoning, 1tsp cayenne pepper, 1tsp chilli powder, lots of black pepper, 1 tbsp of garlic powder...be creative, maybe some cumin and smoked paprika? I added a tsp of cinnamon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mechanize' | |
require 'keychain' | |
class Scraper | |
def initialize(url) | |
@url = url | |
@flows = [] | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[context checking:^{ | |
// simple expectation | |
[expectThat(testObject).receives doSomething]; | |
// with arguments | |
[expectThat(testObject).receives doSomethingWithArgument:@"arg"]; | |
// expectation with cardinality | |
[[expectThat(testObject).receives doSomething] times:1]; | |
[[expectThat(testObject).receives doSomething] atLeast:1]; |