{"id":13621808,"url":"https://github.com/azer/mao","last_synced_at":"2025-08-19T01:08:47.672Z","repository":{"id":9186484,"uuid":"10990041","full_name":"azer/mao","owner":"azer","description":"Pragmatic BDD Testing Framework For Go","archived":false,"fork":false,"pushed_at":"2014-06-26T18:37:18.000Z","size":302,"stargazers_count":100,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T11:53:21.187Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azer.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":"2013-06-27T07:11:25.000Z","updated_at":"2025-03-04T10:53:34.000Z","dependencies_parsed_at":"2022-09-07T12:13:34.133Z","dependency_job_id":null,"html_url":"https://github.com/azer/mao","commit_stats":null,"previous_names":["azer/go-test"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/azer/mao","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fmao","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fmao/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fmao/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fmao/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azer","download_url":"https://codeload.github.com/azer/mao/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azer%2Fmao/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271083801,"owners_count":24696372,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-08-01T21:01:10.775Z","updated_at":"2025-08-19T01:08:47.628Z","avatar_url":"https://github.com/azer.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"## Māo\n\nPragmatic BDD Testing Framework For Go. \n\n```go\nimport \"math\"\n\nDesc(\"math.Abs\", func(it It) {\n  it(\"returns the absolute value of x\", func(expect Expect) {\n    expect(math.Abs(-12)).Equal(12.0)\n    expect(math.Abs(-.5)).Equal(0.5)\n  })\n})\n```\n\n**Why Māo?**\n\n* More flexibility: You can locate your tests in any directory.\n* Don't repeat yourself: Māo does the ceremony for you by preprocessing the test module.\n* Minimalistic Output: Māo doesn't have verbose outputs. It'll output short and briefly, will show you what lines fail in case of any error.\n\nUpdate: **[Development Status](#development-status)**\n\n## Install\n\nInstall the Go library first;\n\n```bash\n$ go install github.com/azer/mao\n```\n\nAnd optionally, install the command-line tool to avoid the boilerplate code: *See examples/simple-with-boilerplate.go if you'd like to skip this step*\n\n```bash\n$ curl https://raw.github.com/azer/mao/master/install | sh\n```\n\n## Usage\n\nCreate a test module anywhere you want and import the code you'd like to test:\n\n```go\nimport \"math/rand\" // or: import \"github.com/you/repository\"\n\nDesc(\"math.Abs\", func(it It) {\n  it(\"returns the absolute value of x\", func(expect Expect) {\n    expect(math.Abs(-12)).Equal(12.0)\n    expect(math.Abs(-.5)).Equal(0.5)\n  })\n})\n```\n\nAnd run it with `mao` command:\n\n```bash\n$ mao test.go\n```\n\nIt'll either output a simple success message that will look like;\n\n```\nRan 3 tests successfully.\n```\n\nOr some error messages with failing source code lines, like following;\n\n![](https://i.cloudup.com/CHNocClka1.png)\n\n## Reference\n\n### BDD API\n\n* Desc\n* It\n* BeforeEach\n* AfterEach\n\n### Assertion API\n\n* Above\n* Equal\n* NotEqual\n* NotExist\n* ResponseBody\n* Lower\n\n## Development Status\n\nI recently think of two major changes in the project;\n\n* Rewriting [the preprocesser](https://github.com/azer/mao/blob/master/mao) (bash script) in Go\n* Replacing \"desc/it\" with \"test\". \n\nSo it'd be looking like;\n\n```go\nimport \"math\"\n\nTest(\"returns the absolute value of x\", func(e Expect) {\n  expect(math.Abs(-12)).Equal(12.0)\n  expect(math.Abs(-.5)).Equal(0.5)\n})\n```\n\nAt this point, I wouldn't recommend to use Mao. I still have the same goal but it may cause some pain since its preprocesser is not reliable enough. \n\nAnd since other projects occupy my time nowadays, I'd appreciate pull requests to reach the goals of the project. Thanks for your interest!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazer%2Fmao","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazer%2Fmao","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazer%2Fmao/lists"}