Tsuga 0.0.8

Tsuga 0.0.8

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by AlexDenisov.



Tsuga 0.0.8

  • By
  • Alex Denisov

Tsuga - set of Cedar helpers

Features

Spec definition

CDR_EXT
Tsuga<Sample>::run(^{
    it(@"sample spec", ^{
        YES should_not be_truthy;
    });
});

Subject

subject([User new]);

it(@"selector", ^{
    subject() should responds_to(@selector(hello));
});

it(@"name", ^{
    subject() should responds_to(@"hello");
});

'should' shorthand

beforeEach(^{
  subject([User new]);
});

it(@"smth", ^{
  ts_should responds_to(@selector(hello)); // subject() should responds_to(@selector(hello))
});

Context helpers

ts_class(^{

    it(@"", ^{
        ts_should equal([User class]);
    });

});

ts_instance(^{

    it(@"", ^{
        ts_should be_instance_of([User class]);
    });

});

Expands to:

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]);
    });

});

RespondsTo

subject should responds_to(@selector(hello));
subject should responds_to(@"hello");
Shorthand
responds(^{
    to(@selector(fuu));
    to(@selector(bar:));
    to(@selector(bu:zz:));
});

ConformsTo

subject should conforms_to(@protocol(Conformable));
subject should conforms_to(@"Conformable");
Shorthand
conforms(^{
    to(@protocol(UITableViewDelegate));
    to(@protocol(PrintableObject));
});