{"id":19816895,"url":"https://github.com/rvm/tf","last_synced_at":"2025-05-01T10:33:18.230Z","repository":{"id":3415599,"uuid":"4466480","full_name":"rvm/tf","owner":"rvm","description":"Testing Framework","archived":false,"fork":false,"pushed_at":"2025-01-30T01:00:48.000Z","size":78,"stargazers_count":10,"open_issues_count":1,"forks_count":5,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-26T23:09:52.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rvm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-28T02:13:36.000Z","updated_at":"2025-03-31T03:45:42.000Z","dependencies_parsed_at":"2022-09-06T21:53:01.390Z","dependency_job_id":null,"html_url":"https://github.com/rvm/tf","commit_stats":null,"previous_names":["mpapis/tf"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Ftf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Ftf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Ftf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Ftf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvm","download_url":"https://codeload.github.com/rvm/tf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251860566,"owners_count":21655769,"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-11-12T10:11:00.482Z","updated_at":"2025-05-01T10:33:17.945Z","avatar_url":"https://github.com/rvm.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testing Framework [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/mpapis/tf) [![Build Status](https://travis-ci.org/rvm/tf.svg?branch=master)](https://travis-ci.org/rvm/tf)\n\nTF is a pluggable framework for testing shell scripts (at least now).\nTF also is an umbrella which incorporates (eventually) multiple gems, each of which provides additional functionality\nto TF. TF is the skeleton upon which all other tf-* gems build.\n\n\n## Usage\n\n    $ gem install tf\n    $ tf \u003cpath/to/file\u003e_comment_test.sh\n    $ tf --text \u003cpath/to/file\u003e_comment_test.sh\n\n## Comment tests\n\nFilename has to end with `_comment_test.sh`\n\nExample test file:\n\n    ## User comments start with double #\n    ## command can be written in one line with multiple tests:\n    true # status=0; match=/^$/\n    ## or tests can be placed in following lines:\n    false\n    # status=1\n\n### Matchers\n\nThe test can be negated by replacing `=` with `!=`\n\n- status=\u003cnumber\u003e - check if command returned given status (0 is success)\n- match=/\u003cregexp\u003e/ - regexp match command output both stdout and stderr\n- match[stdout|stderr]=/\u003cregexp\u003e/ - regexp match command either stdout or stderr\n- env[\u003cvar_name\u003e]=~/\u003cregexp\u003e/ - regexp match the given environment variable name\n- env[\u003cvar_name\u003e]?=[array|string|nil] - verify type of the given environment variable name\n- env[\u003cvar_name\u003e][]=\u003csize\u003e - verify size of the given environment variable name\n- env[\u003cvar_name\u003e][]=/\u003cregexp\u003e/ - regexp match all of elements of the given environment variable name\n- env[\u003cvar_name\u003e][\u003cindex\u003e]=/\u003cregexp\u003e/ - regexp match given element of the given environment variable name\n\n### Selecting shell / runner program\n\nFrom version 0.3.1 Shebang lines are read and interpreted to select the runner shell.\nStill only Bash / ZSH like shells are allowed.\n\n## Example\n\n    $ bin/tf example_tests/comment/*\n    F..\n    ##### Processed commands 2 of 2, success tests 2 of 3, failure tests 1 of 3.\n    $ false\n    # failed: status = 0 # was 1\n\n    $ bin/tf example_tests/comment/* --text\n    ##### starting test failure.\n    $ false\n    # failed: status = 0 # was 1\n    ##### starting test success.\n    $ true\n    # passed: status = 0\n    # passed: status != 1\n    ##### Processed commands 2 of 2, success tests 2 of 3, failure tests 1 of 3.\n\n## Troubleshooting\n\nUse environment variable `TF_DEBUG` to enable additional logging:\n\n    TF_DEBUG=1 tf --text  example_tests/comment/*\n\n## Internal architecture\n\nFramework will load plugins from any available gem and local `lib/` path, for example:\n\n    lib/plugins/tf/text_output.rb\n    lib/plugins/tf/status_test.rb\n    lib/plugins/tf/comment_test_input.rb\n\nThe search pattern is:\n\n    lib/plugins/tf/*.rb\n\nAnd plugins are selected with:\n\n    lib/plugins/tf/*_{input,test,output}.rb\n\n## Thanks\n\n - Deryl R. Doucette\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvm%2Ftf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvm%2Ftf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvm%2Ftf/lists"}