{"id":16345044,"url":"https://github.com/davidegrayson/kata-template-ruby-rspec-watchr","last_synced_at":"2025-11-07T14:30:24.257Z","repository":{"id":4678111,"uuid":"5824612","full_name":"DavidEGrayson/kata-template-ruby-rspec-watchr","owner":"DavidEGrayson","description":"Template for test-driven development katas integrating Ruby, RSpec, and watchr.","archived":false,"fork":false,"pushed_at":"2014-09-18T16:10:17.000Z","size":156,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T10:09:42.066Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidEGrayson.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-15T21:56:51.000Z","updated_at":"2014-09-18T16:10:16.000Z","dependencies_parsed_at":"2022-09-13T11:30:44.677Z","dependency_job_id":null,"html_url":"https://github.com/DavidEGrayson/kata-template-ruby-rspec-watchr","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/DavidEGrayson%2Fkata-template-ruby-rspec-watchr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidEGrayson%2Fkata-template-ruby-rspec-watchr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidEGrayson%2Fkata-template-ruby-rspec-watchr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidEGrayson%2Fkata-template-ruby-rspec-watchr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidEGrayson","download_url":"https://codeload.github.com/DavidEGrayson/kata-template-ruby-rspec-watchr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239533066,"owners_count":19654617,"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-10-11T00:29:43.868Z","updated_at":"2025-11-07T14:30:24.147Z","avatar_url":"https://github.com/DavidEGrayson.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"h1. Kata Template for \"Ruby\":http://www.ruby-lang.org/en/ + \"RSpec\":http://rspec.info/ + \"watchr\":https://github.com/mynyml/watchr\n\nThis is a set of files that makes it easy to get started doing a \"test-driven development\":http://en.wikipedia.org/wiki/Test-driven_development \"coding kata\":http://codekata.pragprog.com/ in the \"Ruby\":http://www.ruby-lang.org/en/ language, using \"RSpec\":http://rspec.info/ as the testing framework, and using \"watchr\":https://github.com/mynyml/watchr to automatically run the tests whenever you change your code.\n\n!http://www.davidegrayson.com/keep/kata-layout-thumb.png!:http://www.davidegrayson.com/keep/kata-layout.png\n\nh2. Getting Started\n\nFirst, clone this repository (or one of its forks) to a new directory named after the kata you want to do.  For example, if you were doing a kata about tennis, you could run:\n\n\u003cpre\u003e\u003ccode\u003egit clone git://github.com/DavidEGrayson/kata-template-ruby-rspec-watchr.git kata_tennis\u003c/code\u003e\u003c/pre\u003e\n\nYou will need a few gems to use this template.  The easiest way to install them is to go into the new directory, run @gem install bundler@, and then run @bundle@; this will install all the gems listed in @Gemfile@.  What version of Ruby you use, and whether or not to use \"RVM\":https://rvm.io/, are decisions that are up to you.\n\nNext, open @spec.rb@, and @kata.rb@ in a text editor.  These two files are where you will write your specs and your code, respectively.\n\nYou can run the specs by running @rake@ at the command line, but you should really run @rake watch@: this will use watchr to automatically run the specs whenever any ruby files in the directory change.\n\nYou can run @rake -T@ to see what rake tasks are available.\n\nh2. Managing multiple attempts with git\n\nIf you will be presenting your kata to an audience, you should practice it multiple times.  I like to use \"git\":http://git-scm.com/ to manage the multiple attempts.  That way you can easily keep the code from all of your attempts and compare them.\n\nBefore each attempt, you can run @git checkout -b tryN master@ to create a new branch named @tryN@, where @N@ is the number of this attempt.  When you have completed your attempt, run @git commit -am@ to commit your changes.\n\nTo see the differences between your current set of files and a previous attempt, run a command like @git diff try1@.  To see the differences between two attempts, run a command like @git diff try1 try2@.\n\nh2. Test-driven development tips\n\n* Repeat the \"Red-Green-Refactor\" pattern:\n## Write a new spec -\u003e test results turn red.\n## Improve your code -\u003e test results turn green.\n## Refactor your code to make it better without breaking the specs.\n* Only write enough code to make your tests pass.\n\nh2. Presentation tips\n\n* *Practice your entire presenation several times beforehand, speaking out loud to yourself.*  This is the most important tip.\n* Practice keyboard shortcuts so that you can give most of the presentation without moving your hand to the mouse.\n* Favor typing code instead of pasting or uncommenting.\n* Figure out how much time is allotted to your presentation, and have a timer running while you practice.  It is good to leave time at the end for questions and feedback, and certain groups will expect that.\n* Hide the OS's bars at the top and bottom to make more vertical room for code.\n* Choose the window layout carefully.  I really like the layout shown in the picture above because it allows you to see the specs, the code, and the test results all at once.  Positive test results are easily identified without switching windows.  A quick _Alt+Tab_ lets you see the full output of the specs when there is an error.\n* Set up everything as much as possible before your presentation begins.\n* Use a text editor that supports Ruby syntax highlighting.\n\nh2. More Resources\n\n* Jason Arhart's \"shuhari\":https://github.com/jarhart/shuhari/tree/master/lib/shuhari gem.  Shuhari generates new projects for doing TDD kata with Ruby+RSpec+Guard.\n* \"RSpec documentation\":https://www.relishapp.com/rspec\n* \"Ruby language documentation\":http://ruby-doc.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidegrayson%2Fkata-template-ruby-rspec-watchr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidegrayson%2Fkata-template-ruby-rspec-watchr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidegrayson%2Fkata-template-ruby-rspec-watchr/lists"}