{"id":22980934,"url":"https://github.com/rubyworks/lime","last_synced_at":"2025-04-02T09:41:56.179Z","repository":{"id":56881223,"uuid":"2098352","full_name":"rubyworks/lime","owner":"rubyworks","description":"Ghirken-style Pure Ruby Test Framework","archived":false,"fork":false,"pushed_at":"2012-06-18T22:13:19.000Z","size":656,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T08:41:11.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://github.com/rubyworks/lime","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"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":"2011-07-24T22:20:06.000Z","updated_at":"2013-10-23T05:16:10.000Z","dependencies_parsed_at":"2022-08-20T22:31:21.331Z","dependency_job_id":null,"html_url":"https://github.com/rubyworks/lime","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/rubyworks%2Flime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Flime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Flime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubyworks%2Flime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubyworks","download_url":"https://codeload.github.com/rubyworks/lime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246793006,"owners_count":20834921,"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-12-15T01:46:13.275Z","updated_at":"2025-04-02T09:41:56.129Z","avatar_url":"https://github.com/rubyworks.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lime\n\n[Website](http://rubyworks.github.com/lime) /\n[Source Code](http://github.com/rubyworks/lime) /\n[Report Issue](http://github.com/rubyworks/lime/issues) /\n[Mailing List](http://groups.google.com/groups/rubyworks-mailinglist)\n\n\n## Description\n\nLime is pure-Ruby Gherkin-style test framework.\n\n\n## Instruction\n\nLime lets you write features scripts using Ruby, yet still do\nso with a close approximation to Gherkin domain language.\n\n``` ruby\nFeature \"Addition\" do\n  To \"avoid silly mistakes\"\n  As \"a math idiot\"\n  We \"need to calculate the sum of numbers\"\n\n  Scenario \"Add two numbers\" do\n    Given \"I have a calculator\"\n    Given \"I have entered 50 into the calculator\"\n    Given \"I have entered 70 into the calculator\"\n    When  \"I press add\"\n    Then  \"the result should be 120 on the screen\"\n  end\n\n  Scenario \"Add three numbers\" do\n    Given \"I have a calculator\"\n    Given \"I have entered 50 into the calculator\"\n    Given \"I have entered 70 into the calculator\"\n    Given \"I have entered 90 into the calculator\"\n    When  \"I press add\"\n    Then  \"the result should be 2101 on the screen\"\n  end\n\n  Given 'I have a calculator' do\n    require 'calculator'\n    @calculator = Calculator.new\n  end\n\n  Given 'I have entered (((\\d+))) into the calculator' do |n|\n    @calculator.push n.to_i\n  end\n\n  When 'I press add' do\n    @result = @calculator.add\n  end\n\n  Then 'the result should be (((\\d+))) on the screen' do |n|\n    @result.assert == n.to_i\n  end\nend\n```\n\nThe last set of `Given` and `When` procedures are called the *advice definitions*. These\ncan be placed in their own modules and included into the Feature scope like any other module.\nThey simply need to include the `Lime::Featurette` module to do so. For instance:\n\n```ruby\nmodule CalculatorAdvice\n  include Lime::Featurette\n\n  Given 'I have a calculator' do\n    require 'calculator'\n    @calculator = Calculator.new\n  end\n\n  Given 'I have entered (((\\d+))) into the calculator' do |n|\n    @calculator.push n.to_i\n  end\n\n  When 'I press add' do\n    @result = @calculator.add\n  end\n\n  Then 'the result should be (((\\d+))) on the screen' do |n|\n    @result.assert == n.to_i\n  end\nend\n```\n\nIf you add such scripts to a subdirectory called `featurettes` relative to the\nfeature that uses them, then they will be loaded automatically when features\nare run.\n\nSpeaking of which, to run features use the `rubytest` command line tool.\n\n```\n$ rubytest -Ilib spec/feature_addition.rb\n```\n\nSee [RubyTest](http://rubyworks.github.com/rubytest) to learn more.\n\n\n## Copyrights\n\nCopyright (c) 2011 Rubyworks\n\nLime is distributed according to the terms of the *FreeBSD* license.\n\nSee LICENSE.txt for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyworks%2Flime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubyworks%2Flime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubyworks%2Flime/lists"}