CDR_EXT
Tsuga<Sample>::run(^{
it(@"sample spec", ^{
YES should_not be_truthy;
});
});
subject([User new]);
it(@"selector", ^{
subject() should responds_to(@selector(hello));
});
it(@"name", ^{
subject() should responds_to(@"hello");
});
beforeEach(^{
subject([User new]);
});
it(@"smth", ^{
ts_should responds_to(@selector(hello)); // subject() should responds_to(@selector(hello))
});
ts_class(^{
it(@"", ^{
ts_should equal([User class]);
});
});
ts_instance(^{
it(@"", ^{
ts_should be_instance_of([User class]);
});
});
展开为
context(@"class", ^{
beforeEach(^{
subject([SomeClass class]);
});
it(@"", ^{
ts_should equal([User class]);
});
});
context(@"instance", ^{
beforeEach(^{
subject([SomeClass new]);
});
it(@"", ^{
ts_should be_instance_of([User class]);
});
});
subject should responds_to(@selector(hello));
subject should responds_to(@"hello");
responds(^{
to(@selector(fuu));
to(@selector(bar:));
to(@selector(bu:zz:));
});
subject should conforms_to(@protocol(Conformable));
subject should conforms_to(@"Conformable");
conforms(^{
to(@protocol(UITableViewDelegate));
to(@protocol(PrintableObject));
});