{"id":16948989,"url":"https://github.com/technicalpickles/file_fixture","last_synced_at":"2025-03-21T10:10:02.396Z","repository":{"id":66022974,"uuid":"33826","full_name":"technicalpickles/file_fixture","owner":"technicalpickles","description":"A helper method for loading files during test","archived":false,"fork":false,"pushed_at":"2008-07-14T15:18:44.000Z","size":80,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-15T00:29:58.098Z","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/technicalpickles.png","metadata":{"files":{"readme":"README.markdown","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":"2008-07-14T00:07:27.000Z","updated_at":"2019-08-13T13:29:06.000Z","dependencies_parsed_at":"2023-02-19T21:30:36.165Z","dependency_job_id":null,"html_url":"https://github.com/technicalpickles/file_fixture","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/technicalpickles%2Ffile_fixture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Ffile_fixture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Ffile_fixture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technicalpickles%2Ffile_fixture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technicalpickles","download_url":"https://codeload.github.com/technicalpickles/file_fixture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244776338,"owners_count":20508506,"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-13T21:52:52.116Z","updated_at":"2025-03-21T10:10:02.371Z","avatar_url":"https://github.com/technicalpickles.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# file\\_fixture\n\n## Installing\n\n    gem install technicalpickles-file_fixture -s http://gems.github.com\n\n## Usage\n\nfile\\_fixture provide provides a convenience method for loading data from files. To use, you just add the snippet to your `test_helper.rb`:\n\n    require 'file_fixture/test_unit'\n    FileFixture::FIXTURE_DIR = File.join(File.dirname(__FILE__), \"file_fixtures\")\n\nPlace files into the `file_fixtures` directory, and then you can use `file_fixture 'foo'` to read and return `file_fixtures/foo`.\n\nIf you were building wrappers around web APIs, you should use static data instead of hitting the API directly. We can use file_fixture to implement this helper method:\n\n    def stubbing_http_response_with_fixture(file)\n      response = stub(:body =\u003e file_fixture(file), :value =\u003e nil)\n      Net::HTTP.any_instance.stubs(:request).returns(response)\n\n      yield\n    end\n\nYou could then use this in tests like:\n\n    stubbing_http_response_with_fixture('get_tags.xml') do\n      assert_equal 6, @user.tags.size # @user.tags does a HTTP request\n    end\n\n## License\n\nSee LICENSE","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicalpickles%2Ffile_fixture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnicalpickles%2Ffile_fixture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnicalpickles%2Ffile_fixture/lists"}