{"id":17069824,"url":"https://github.com/jlong/test_helpers","last_synced_at":"2026-05-18T03:34:58.382Z","repository":{"id":670646,"uuid":"313970","full_name":"jlong/test_helpers","owner":"jlong","description":"An older Rails plugin that adds support for test helpers","archived":false,"fork":false,"pushed_at":"2009-09-22T03:57:44.000Z","size":76,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-19T08:44:57.587Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlong.png","metadata":{"files":{"readme":"README","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}},"created_at":"2009-09-22T03:55:09.000Z","updated_at":"2013-11-09T07:31:05.000Z","dependencies_parsed_at":"2022-07-07T23:29:04.034Z","dependency_job_id":null,"html_url":"https://github.com/jlong/test_helpers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jlong/test_helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlong%2Ftest_helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlong%2Ftest_helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlong%2Ftest_helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlong%2Ftest_helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlong","download_url":"https://codeload.github.com/jlong/test_helpers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlong%2Ftest_helpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33163773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"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":"2024-10-14T11:27:57.440Z","updated_at":"2026-05-18T03:34:58.368Z","avatar_url":"https://github.com/jlong.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Test Helpers for Rails\n======================\n\nThis plugin adds a couple of class methods to Test::Unit::TestCase to make it \neasy to share helper methods between test cases in modules.\n\nA typical Rails project has the following test directory structure:\n\n  test/         # the root test directory\n    fixtures/   # fixtures used while testing\n    functional/ # functional tests\n    unit/       # unit tests\n\nThe test_helpers Rails plugin adds an additional directory:\n\n  test/\n    helpers/\n\nDrop modules in the \"test/helpers\" that contain code that you would like to \nshare between test cases. For example. Suppose you created a couple of custom \nassertions that you would like to use in your test cases. You could create a \ncustom module (MyAssertionsTestHelper) and drop it in the \"test/helpers\" \ndirectory like this:\n\n  module MyAssertionsTestHelper\n\n    def assert_this(expected, result)\n      # implementation\n    end\n\n    def assert_that(expected, result)\n      # impementation\n    end\n\n  end\n\nBe sure that both the module name and filename end with \"TestHelper\" (so for \nthe module above the filename should be \"my_assertions_test_helper.rb\").\n\nNow, in a test case where you would like to use the test helper simply invoke \nthe \"test_helper\" class method:\n\n  class MyTest \u003c Test::Unit::TestCase\n\n    test_helper :my_assertions\n\n    def test_custom_assertion\n      assert_this(123, 456)\n      assert_that(\"abc\", \"def\")\n    end\n  \n  end\n\nThe \"test_helper\" class method takes an array of symbols and automatically \nloads and includes the appropriate modules. In the example above it examines \nthe :my_assertions symbol and concludes that you want to require \n\"test/helper/my_assertions_test_helper\" and include MyAssertionsTestHelper \ninto your test case.\n\nIf you would like to modify the test helper load path you can do so with the \n\"test_helper_paths\" class method:\n\n  class Test::Unit::TestCase\n    self.test_helper_paths \u003c\u003c '/custom/helper/path'\n  end\n\nThe test helper plugin is Copyright (c) John W. Long, 2007 and is available \nunder the same license as Rails.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlong%2Ftest_helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlong%2Ftest_helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlong%2Ftest_helpers/lists"}