Skip to content

Instantly share code, notes, and snippets.

@Shadowfiend
Created July 23, 2009 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shadowfiend/153673 to your computer and use it in GitHub Desktop.
Save Shadowfiend/153673 to your computer and use it in GitHub Desktop.
@implementation MyClass : CPObject
{
}
- (CPNumber)reverse
{
return 5;
}
@end
[Test for: MyClass
beforeEach: function() {
this.instance = [[MyClass alloc] init]
}
checking: function() {
[MyClass should: "return 5 for reversing"
by: function() {
[[this.instance reverse] shouldEqual: 5];
}];
[MyClass should: "return 4 for reversing"
by: function() {
[[this.instance reverse] shouldEqual: 4]
}];
[MyClass should: "fail with an exception baby"
by: function() {
[[this.instance reverse] shouldNotEqual: "nothing"]
}];
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment