This file contains 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
class Entry | |
attr_accessor :wins | |
attr_accessor :losses | |
def initialize | |
self.wins = 0 | |
self.losses = 0 | |
end |
This file contains 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
class ThingController < ApplicationController | |
def create_suck | |
@thing = Thing.new(params[:thing]) | |
respond_to do |format| | |
if @thing.save | |
format.html { redirect_to @thing, notice: 'thing was successfully created.' } | |
format.json { render json: @thing, status: :created, location: @thing } | |
else |
This file contains 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 CappuccinoResource : CPObject | |
{ | |
} | |
-(CPString)baseClassName { | |
if( [super className] == 'CappuccinoResource') | |
return [self className] | |
return [super baseClassName] | |
} |
This file contains 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
var x = nil; | |
[CPURLConnection sendSynchronousRequest: aRequest returningResponse: x] | |
CPLog(aRequest); | |
CPLog(x); | |
CPLog(aRequest.responseText) | |
CPLog(aRequest.status) | |
# prints | |
<CPURLRequest 0x001c00> | |
null |
This file contains 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
[self assertTrue:CGRectContainsPoint( | |
CGRectMake(0,0,1,1), | |
CGPointMake(1,1) | |
) message:"point should be in rectangle"]; |
This file contains 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
ArrowViewTest.2010-01-26 14:25:57.884 Cappuccino [error]: addError test=[ArrowViewTest test_top_arrow_has_label] error=TypeError: Cannot read property "gState" from null | |
2010-01-26 14:25:57.891 Cappuccino [error]: at script(/usr/local/narwhal/packages/cappuccino/Frameworks/Debug/AppKit/CGContext.j:217) | |
at script((Anonymous):46) | |
at script((Anonymous):16) | |
at script((Anonymous):29) | |
at script((Anonymous):55) | |
at script((Anonymous):24) | |
at script((Anonymous):109) | |
at script((Anonymous):70) | |
at script((Anonymous):57) |
This file contains 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)drawRect:(NSRect)aRect { | |
CPLog("drawing arrow:" + self); | |
var context = [[CPGraphicsContext currentContext] graphicsPort]; | |
CGContextSetAlpha(context, 1); | |
CGContextSetStrokeColor(context, [CPColor redColor]); | |
CGContextMoveToPoint(context,startPoint.x, startPoint.y); | |
CGContextAddLineToPoint(context, endPoint.x, endPoint.y); | |
CGContextStrokePath(context); | |
} |
This file contains 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
@import "../../models/Wall.j" | |
[Test for:Wall | |
beforeAll: function() { | |
wall = [[Wall alloc] init] | |
} | |
checking: function() { |
This file contains 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
[view setDelegate:mockDelegate]; | |
[mockDelegate selector:@selector(resizePlaceableExclusionZoneView:) times:1]; | |
[self assert:view equals:[button target]]; | |
[self assert:@selector(actionResize:) equals:[button action]]; | |
// If I uncomment out this line, the test passes. | |
// [view actionResize:nil]; | |
// but if I uncomment this line, the test fails. | |
[button performClick:nil]; |
This file contains 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
//--------------- | |
// This test: | |
// -------------- | |
-(void)setUp{ | |
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0,0,200,150) | |
styleMask:CPWindowNotSizable]; | |
} | |
-(void)test_set_size_displays_resizer {} |
NewerOlder