{"id":16288735,"url":"https://github.com/nodeg/ruby-testing","last_synced_at":"2026-03-03T14:33:33.688Z","repository":{"id":193031435,"uuid":"687965765","full_name":"nodeg/ruby-testing","owner":"nodeg","description":"Basic tests in Ruby for understanding TDD and BDD","archived":false,"fork":false,"pushed_at":"2024-11-04T10:02:42.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-17T14:04:18.110Z","etag":null,"topics":["bdd","github-actions","ruby","tdd","testing"],"latest_commit_sha":null,"homepage":"","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/nodeg.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-06T11:29:34.000Z","updated_at":"2024-11-04T10:02:44.000Z","dependencies_parsed_at":"2023-09-06T13:12:29.913Z","dependency_job_id":"2d197b33-8cbb-4641-9ec8-ab5d44b7dbd7","html_url":"https://github.com/nodeg/ruby-testing","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":"0.19999999999999996","last_synced_commit":"808eb3f1ad1f4442232de117661eae7eb6e37b46"},"previous_names":["nodeg/ruby-testing"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeg%2Fruby-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeg%2Fruby-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeg%2Fruby-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeg%2Fruby-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodeg","download_url":"https://codeload.github.com/nodeg/ruby-testing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244543720,"owners_count":20469550,"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":["bdd","github-actions","ruby","tdd","testing"],"created_at":"2024-10-10T19:49:16.647Z","updated_at":"2026-03-03T14:33:33.658Z","avatar_url":"https://github.com/nodeg.png","language":"Ruby","readme":"[![Tests](https://github.com/nodeg/ruby-testing/actions/workflows/tests.yml/badge.svg)](https://github.com/nodeg/ruby-testing/actions/workflows/tests.yml)\n[![RuboCop](https://github.com/nodeg/ruby-testing/actions/workflows/rubocop.yml/badge.svg)](https://github.com/nodeg/ruby-testing/actions/workflows/rubocop.yml)\n\n# Testing using Ruby and Cucumber\n\nThese are some very basic examples on how TDD and BDD work in Ruby.\n\n## Test-driven development (TDD)\n\n### General principles\n\n1. Write the smallest possible test case (unit test) for one unit in the code.\n1. Run the test and watch it failing.\n1. Write the actual code for this unit.\n1. Run the test again.\n1. Repeat this as long as the test passes and refactor the code in the process.\n\n### Executing the test\n\n* Go inside the `tdd` folder\n* Execute the test with\n\n```bash\nruby tests/hello_test.rb\n```\n\nThe test explicitly does not fail because of the CI tests.\n\n## Behavior-driven development (BDD)\n\nThe idea behind BDD is built on top of TDD, with the difference of writing tests as a\nspecification of the behavior of a system instead of just testing the code.\n\n### Initialize Cucumber\n\nBefore you start with Cucumber, you need to initializes the folder structure and\ngenerate conventional files. This was already done here and you only need it when\nyou start a fresh project.\n\n### Executing the BDD tests\n\n* Go inside the `bdd` folder\n* Execute the test with\n\n```bash\n# execute all tests\ncucumber\n\n# execute one specific test\ncucumber features/calculator.feature\ncucumber features/hello.feature\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodeg%2Fruby-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodeg%2Fruby-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodeg%2Fruby-testing/lists"}