Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexdenisov/tsuga
Set of helpers for pivotal/cedar
https://github.com/alexdenisov/tsuga
Last synced: about 1 month ago
JSON representation
Set of helpers for pivotal/cedar
- Host: GitHub
- URL: https://github.com/alexdenisov/tsuga
- Owner: AlexDenisov
- License: mit
- Created: 2013-05-21T20:23:14.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-07-12T14:17:04.000Z (over 11 years ago)
- Last Synced: 2023-09-17T05:01:09.253Z (about 1 year ago)
- Language: Objective-C
- Homepage:
- Size: 242 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## [Tsuga](http://en.wikipedia.org/wiki/Tsuga) - set of [Cedar](https://github.com/pivotal/cedar) helpers
### Features
#### Spec definition
```cpp
CDR_EXT
Tsuga::run(^{
it(@"sample spec", ^{
YES should_not be_truthy;
});
});
```#### Subject
```cpp
subject([User new]);
it(@"selector", ^{
subject() should responds_to(@selector(hello));
});it(@"name", ^{
subject() should responds_to(@"hello");
});```
#### 'should' shorthand```cpp
beforeEach(^{
subject([User new]);
});it(@"smth", ^{
ts_should responds_to(@selector(hello)); // subject() should responds_to(@selector(hello))
});
```#### Context helpers
```cpp
ts_class(^{
it(@"", ^{
ts_should equal([User class]);
});
});ts_instance(^{
it(@"", ^{
ts_should be_instance_of([User class]);
});
});
```Expands to:
```cpp
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
```cpp
subject should responds_to(@selector(hello));
subject should responds_to(@"hello");
```##### Shorthand
```cpp
responds(^{
to(@selector(fuu));
to(@selector(bar:));
to(@selector(bu:zz:));
});
```#### ConformsTo
```cpp
subject should conforms_to(@protocol(Conformable));
subject should conforms_to(@"Conformable");
```##### Shorthand
```cpp
conforms(^{
to(@protocol(UITableViewDelegate));
to(@protocol(PrintableObject));
});
```