{"id":19049285,"url":"https://github.com/cppforlife/cedarasync","last_synced_at":"2025-07-17T22:35:06.891Z","repository":{"id":5172434,"uuid":"6346102","full_name":"cppforlife/CedarAsync","owner":"cppforlife","description":"asynchronous testing for Cedar (and others)","archived":false,"fork":false,"pushed_at":"2020-02-08T13:40:43.000Z","size":1098,"stargazers_count":17,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T01:05:32.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tobias-turborilla/segmentio-unity","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cppforlife.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-23T03:11:07.000Z","updated_at":"2020-02-08T13:30:08.000Z","dependencies_parsed_at":"2022-07-06T07:33:45.484Z","dependency_job_id":null,"html_url":"https://github.com/cppforlife/CedarAsync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppforlife%2FCedarAsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppforlife%2FCedarAsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppforlife%2FCedarAsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppforlife%2FCedarAsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cppforlife","download_url":"https://codeload.github.com/cppforlife/CedarAsync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540948,"owners_count":21447427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T23:10:25.871Z","updated_at":"2025-04-24T01:05:52.892Z","avatar_url":"https://github.com/cppforlife.png","language":"Objective-C","readme":"CedarAsync lets you use [Cedar](http://github.com/pivotal/cedar) matchers to \ntest asynchronous code. This becomes useful when writing intergration tests \nrather than plain unit tests. (CedarAsync only supports Cedar's should syntax.)\n\nInstead of\n\n    client.lastResponse should contain(@\"Google\");\n\nuse\n\n    in_time(client.lastResponse) should contain(@\"Google\");\n\nto force `contain` matcher check `client.lastResponse` multiple times until \nit succeeds or times out.\n\n### Example\n\n    #import \"CedarAsync.h\"\n    #import \"HTTPClient.h\"\n    \n    SPEC_BEGIN(HTTPClientSpec)\n    \n    using namespace Cedar::Matchers;\n    \n    describe(@\"HTTPClient\", ^{\n        __block HTTPClient *client;\n        \n        beforeEach(^{\n            client = [[[HTTPClient alloc] init] autorelease];\n        });\n        \n        it(@\"can fetch google's homepage\", ^{\n            // uses NSURLRequest internally\n            [client fetchURLString:@\"http://google.com\"];\n            \n            // plain Cedar matcher use - does not wait\n            // (passes immediately since it takes sometime to fetch google)\n            client.lastResponse should be_nil;\n            \n            // async matcher use - waits for lastResponse to contain 'Google'\n            in_time(client.lastResponse) should contain(@\"Google\");\n        });\n    });\n\n    SPEC_END\n\n### Timeout \u0026 Polling Interval\n\nTemporarily change timeout and polling interval:\n\n    CedarAsync::Timing::current_timeout = 4; // seconds\n    CedarAsync::Timing::current_poll = 0.3;  // seconds\n\nor\n\n    with_timeout(10, ^{\n        in_time(valueThatTakesForever) should equal(@\"so large...\");\n    });\n\nChange default timeout and polling interval (these values are used to populate\n`current_timeout` and `current_poll` before every test run):\n\n    CedarAsync::Timing::default_timeout = 4; // seconds\n    CedarAsync::Timing::default_poll = 2;    // seconds\n\n### Todo\n\n- clean up queued up actions on NSRunLoop, GCD, etc. after every test\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcppforlife%2Fcedarasync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcppforlife%2Fcedarasync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcppforlife%2Fcedarasync/lists"}