{"id":33178067,"url":"https://rubyworks.github.io/lemon/","last_synced_at":"2025-11-20T21:01:16.008Z","repository":{"id":703067,"uuid":"349040","full_name":"rubyworks/lemon","owner":"rubyworks","description":"Pucker-Strength Unit Testing","archived":false,"fork":false,"pushed_at":"2022-10-30T19:09:40.000Z","size":1772,"stargazers_count":9,"open_issues_count":9,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-07T22:28:29.168Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rubyworks.github.com/lemon","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Jay-Oh-eN/meteor-ace","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubyworks.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-10-25T13:37:59.000Z","updated_at":"2022-10-31T08:02:10.000Z","dependencies_parsed_at":"2023-01-13T10:37:22.195Z","dependency_job_id":null,"html_url":"https://github.com/rubyworks/lemon","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/rubyworks/lemon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Flemon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Flemon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Flemon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Flemon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubyworks","download_url":"https://codeload.github.com/rubyworks/lemon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Flemon/sbom","scorecard":{"id":789014,"data":{"date":"2025-08-11","repo":{"name":"github.com/rubyworks/lemon","commit":"c083f76b43f2db57c0f1ce8fbb9c4acba7b12162"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T06:55:53.431Z","repository_id":703067,"created_at":"2025-08-23T06:55:53.432Z","updated_at":"2025-08-23T06:55:53.432Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285511776,"owners_count":27184237,"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-11-20T02:00:05.334Z","response_time":54,"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":"2025-11-16T03:00:30.885Z","updated_at":"2025-11-20T21:01:16.003Z","avatar_url":"https://github.com/rubyworks.png","language":"Ruby","readme":"# Lemon\n\n[Homepage](http://rubyworks.github.com/lemon) |\n[User Guide](http://wiki.github.com/rubyworks/lemon) |\n[Development](http://github.com/rubyworks/lemon) |\n[Issues](http://github.com/rubyworks/lemon/issues)\n\n[![Build Status](https://secure.travis-ci.org/rubyworks/lemon.png)](http://travis-ci.org/rubyworks/lemon)\n\n\n## DESCRIPTION\n\nLemon is a Unit Testing Framework that enforces a strict test structure mirroring the class/module and method structure of the target code. Arguably this promotes the proper technique for low-level unit testing and helps ensure good test coverage.\n\nThe difference between unit testing and functional testing, and all other forms of testing for that matter, is simply a matter of where the testing *concern* lies. The concerns of unit testing are the concerns of unit tests, which, in object-oriented design, drills down to individual methods.\n\n**IMPORTANT!** As of v0.9+ the API has changed. The `unit :name =\u003e \"description\"` notation is no longer supported.\n\n\n## EXAMPLE\n\nLemon tests are broken down into target class or module and target methods.\nWithin these lie the actual tests.\n\nLet's say we have a script 'mylib.rb' consisting of the class X:\n\n``` ruby\nclass X\n  def a; \"a\"; end\nend\n```\n\nAn test case for the class would be written:\n\n``` ruby\ncovers 'mylib'\n\ntestcase X do\n\n  setup \"Description of setup.\" do\n    @x = X.new\n  end\n\n  method :a do\n    test \"method #a does something expected\" do\n      @x.a.assert.is_a? String\n    end\n\n    test \"method #a does something else expected\" do\n      @x.a.assert == \"x\"\n    end\n  end\n\nend\n```\n\nThe `covers` method works just like `require` with the exception that it records the file for reference --under certain scenarios it can be used to improve test coverage analysis.\n\nThe setup (also called the *concern*) is run for every subsequent test until a new setup is defined.\n\nIn conjunction with the `#setup` method, there is a `#teardown` method which can be used \"tidy-up\" after each test.\n\nThe `#unit` method is also aliased as `#methed` which is actually a bit more readable. Along with that there is `class_unit` and it's alias `class_method` for testing class-level methods. Also note that the test methods may be capitalized (e.g. `#TestCase'), if you prefer that style.\n\nThat is the bulk of the matter for writing Lemon tests. To learn about additional features not mentioned here, check-out the [User Guide](http://wiki.github.com/rubyworks/lemon).\n\n\n## USAGE\n\n### Running Tests\n\nTests can be run using the `lemons` command line tool.\n\n    $ lemons test test/cases/name_case.rb\n\nLemon utilizes the RubyTest universal test harness to run tests, the `lemons test` command simply passes off control to `rubytest` command. So the `rubytest` command-line utility can also be used directly:\n\n    $ rubytest -r lemon test/cases/name_case.rb\n\nNormal output is typically a _dot progression_. Other output types can be specified by the `--format` or `-f` option.\n\n    $ rubytest -r lemon -f tapy test/cases/name_case.rb\n\nSee [RubyTest](http://rubyworks.github.com/rubytest) for more information.\n\n### Checking Test Coverage\n\nLemon can check per-unit test coverage by loading your target system and comparing it to your tests. To do this use the `lemons coverage` command.\n\n    $ lemons coverage -Ilib test/cases/*.rb\n\nThe coverage tool provides class/module and method coverage and is meant as a \"guidance system\" for developers working toward complete test coverage. It is not a LOC (lines of code) coverage tool and should not be considered a substitute for one.\n\n### Generating Test Skeletons\n\nBecause of the one-to-one correspondence of test case and unit test to class/module and method, Lemon can also generate test scaffolding for previously written code. To do this, use the `lemons generate` or `lemons scaffold` command line utilities. \n\nThe `generate` command outputs test skeletons to the console. You can use this output as a simple reference or redirect the output to a file and then copy and paste portions into separate files as desired. The `scaffold` command will create actual files in your test directory. Other than that, and the options that go with it (e.g. `--output`), the two commands are the same.\n\nTo get a set of test skeletons simply provide the files to be covered.\n\n    $ lemons generate lib/**/*.rb\n\nThe generator can take into account tests already written, so as not to include units that already have tests. To do this provide a list of test files after a dash (`-`).\n\n    $ lemons generate -Ilib lib/**/*.rb - test/**/*.rb\n\nTest skeletons can be generated on a per-file or per-case bases. By case is the default. Use the `-f`/`--file` option to do otherwise.\n\n    $ lemon scaffold -f lib/foo.rb\n\nThe default output location is `test/`. You can change this with the `-o/--output` option.\n\nGenerating test case scaffolding from code will undoubtedly strike test-driven developers as a case of putting the cart before the horse. However, it is not unreasonable to argue that high-level, behavior-driven, functional testing frameworks, such as Q.E.D. and Cucumber, are better suited to test-first methodologies. While test-driven development can obviously be done with Lemon, unit-testing best suited to testing specific, critical portions of code, or for achieving full test coverage for mission critical applications.\n\n### Test Directory\n\nThere is no special directory for Lemon tests. Since they are unit tests, `test/` or `test/unit/` are good choices. Other options are `cases/` and `test/cases` since each file generally defines a single test case.\n\n\n## COPYRIGHTS\n\nLemon Unit Testing Framework\n\nCopyright (c) 2009 Thomas Sawyer, Rubyworks\n\nLemon is distributable in accordance with the **FreeBSD** license.\n\nSee the LICENSE.txt for details.\n","funding_links":[],"categories":["Testing"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/rubyworks.github.io%2Flemon%2F","html_url":"https://awesome.ecosyste.ms/projects/rubyworks.github.io%2Flemon%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/rubyworks.github.io%2Flemon%2F/lists"}