{"id":21502400,"url":"https://github.com/fixrb/fix-expect","last_synced_at":"2026-02-09T21:36:40.687Z","repository":{"id":56846586,"uuid":"44486395","full_name":"fixrb/fix-expect","owner":"fixrb","description":"Fix extension gem to provide the expect syntax.","archived":false,"fork":false,"pushed_at":"2024-05-16T19:00:58.000Z","size":37,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T12:33:53.616Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/fixrb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-10-18T16:36:42.000Z","updated_at":"2021-05-13T13:41:21.000Z","dependencies_parsed_at":"2025-08-30T10:34:20.485Z","dependency_job_id":"cb0dc5e8-dc03-44d7-855a-7e7393b5f777","html_url":"https://github.com/fixrb/fix-expect","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/fixrb/fix-expect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixrb%2Ffix-expect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixrb%2Ffix-expect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixrb%2Ffix-expect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixrb%2Ffix-expect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fixrb","download_url":"https://codeload.github.com/fixrb/fix-expect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixrb%2Ffix-expect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29281976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T19:05:41.198Z","status":"ssl_error","status_checked_at":"2026-02-09T19:05:37.449Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ruby"],"created_at":"2024-11-23T18:14:46.742Z","updated_at":"2026-02-09T21:36:40.650Z","avatar_url":"https://github.com/fixrb.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fix::Expect\n\n[![Build Status](https://api.travis-ci.org/fixrb/fix-expect.svg?branch=main)][travis]\n[![Code Climate](https://codeclimate.com/github/fixrb/fix-expect/badges/gpa.svg)][codeclimate]\n[![Gem Version](https://badge.fury.io/rb/fix-expect.svg)][gem]\n[![Inline docs](https://inch-ci.org/github/fixrb/fix-expect.svg?branch=main)][inchpages]\n[![Documentation](https://img.shields.io/:yard-docs-38c800.svg)][rubydoc]\n\n\u003e Provides the `expect` syntax.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"fix-expect\"\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install fix-expect\n\n## Usage\n\n### The `expect` method\n\n__Fix::Expect__ lets you express expected outcomes on an object, thanks to [Spectus](https://rubygems.org/gems/spectus)'s `MUST` and `MUST_NOT` requirement levels.\n\nAn **absolute requirement** example:\n\n```ruby\nFix do\n  it { expect(-42.abs).to equal 42 }\nend\n```\n\n\u003e (irb):2: Success: expected to equal 42.\n\nAn **absolute prohibition** example:\n\n```ruby\nFix do\n  it { expect(-42).not_to equal 42 }\nend\n```\n\n\u003e (irb):5: Success: expected -42 not to equal 42.\n\nThus, rather than inferring the actual value (which is `41.next`) from the context\nand calculating its value (which is `42`),\n\nrather than letting Fix's default behavior define and compute `41.next` as the actual value to challenge,\nthe `expect` method short circuit it with its argument.\n\nThese 2 examples are equivalent:\n\n```ruby\nFix 41 do\n  on :next do\n    it { MUST equal 42 }\n    it { expect(41.next).to equal 42 }\n  end\n\n  it { MUST equal 41 }\n  it { expect(41.next).to equal 42 }\nend\n```\n\n\u003e (irb):9: Success: expected to equal 42.\n\u003e (irb):10: Success: expected to equal 42.\n\u003e (irb):13: Success: expected to equal 41.\n\u003e (irb):14: Success: expected to equal 42.\n\nThe block syntax is also allowed:\n\n```ruby\nFix do\n  it { expect { -42.abs }.to equal 42 }\nend\n```\n\n\u003e (irb):2: Success: expected to equal 42.\n\n```ruby\nFix do\n  it { expect { 4 / 0 }.to raise_exception ZeroDivisionError }\nend\n```\n\n\u003e (irb):5: Success: divided by 0.\n\n### The `is_expected` method\n\nFor convenience, an `is_expected` method is provided,\nas an alias of Spectus's [MUST](https://github.com/fixrb/spectus#absolute-requirement):\n\n```ruby\nFix 41 do\n  on :next do\n    it { is_expected.to equal 42 }\n  end\nend\n```\n\n\u003e (irb):3: Success: expected to equal 42.\n\n### Code Isolation\n\nWhen executing expectations, side-effects may occur.\nBecause they may or may not be desired, each requirement level has 2 versions:\n\n* if it is performed with `do`, a test is performed without isolation;\n* if it is performed with `do!`, a test is performed in isolation.\n\nExample of test without isolation:\n\n```ruby\ngreeting = \"Hello, world!\"\n\nFix do\n  it \"tests without isolation\" do\n    expect { greeting.gsub!(\"world\", \"Alice\") }.to equal \"Hello, Alice!\"\n  end\nend\n\ngreeting # =\u003e \"Hello, Alice!\"\n```\n\nExample of test in isolation:\n\n```ruby\ngreeting = \"Hello, world!\"\n\nFix do\n  it \"tests with isolation\" do\n    expect { greeting.gsub!(\"world\", \"Alice\") }.to! equal \"Hello, Alice!\"\n  end\nend\n\ngreeting # =\u003e \"Hello, world!\"\n```\n\n## Contact\n\n* Source code: https://github.com/fixrb/fix-expect\n\n## Versioning\n\n__Fix::Expect__ follows [Semantic Versioning 2.0](https://semver.org/).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n***\n\n\u003cp\u003e\n  This project is sponsored by:\u003cbr /\u003e\n  \u003ca href=\"https://sashite.com/\"\u003e\u003cimg\n    src=\"https://github.com/fixrb/fix-expect/raw/main/img/sashite.png\"\n    alt=\"Sashite\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n[gem]: https://rubygems.org/gems/fix-expect\n[travis]: https://travis-ci.org/fixrb/fix-expect\n[codeclimate]: https://codeclimate.com/github/fixrb/fix-expect\n[inchpages]: https://inch-ci.org/github/fixrb/fix-expect\n[rubydoc]: https://rubydoc.info/gems/fix-expect/frames\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixrb%2Ffix-expect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffixrb%2Ffix-expect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixrb%2Ffix-expect/lists"}