{"id":17477472,"url":"https://github.com/testcontainers/testcontainers-ruby","last_synced_at":"2025-04-08T02:36:23.581Z","repository":{"id":160938315,"uuid":"635723981","full_name":"testcontainers/testcontainers-ruby","owner":"testcontainers","description":"Testcontainers for Ruby","archived":false,"fork":false,"pushed_at":"2025-03-25T17:34:36.000Z","size":291,"stargazers_count":146,"open_issues_count":9,"forks_count":19,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-03T04:39:51.687Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/testcontainers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-03T10:17:36.000Z","updated_at":"2025-03-25T17:33:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"db88c0fa-ed42-483f-b61f-8b52045cd64a","html_url":"https://github.com/testcontainers/testcontainers-ruby","commit_stats":{"total_commits":137,"total_committers":9,"mean_commits":"15.222222222222221","dds":"0.24087591240875916","last_synced_commit":"9ef8bf5134093d31c054a5edc0477aef2a4819d9"},"previous_names":["guilleiguaran/testcontainers-ruby"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testcontainers%2Ftestcontainers-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testcontainers%2Ftestcontainers-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testcontainers%2Ftestcontainers-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testcontainers%2Ftestcontainers-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testcontainers","download_url":"https://codeload.github.com/testcontainers/testcontainers-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492781,"owners_count":20947587,"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-18T20:08:08.407Z","updated_at":"2025-04-08T02:36:23.561Z","avatar_url":"https://github.com/testcontainers.png","language":"Ruby","funding_links":[],"categories":["Languages"],"sub_categories":[],"readme":"# Testcontainers\n\nTestcontainers is a Ruby library that provides a convenient way to run Docker containers for your tests. It is inspired by the popular Testcontainers library for Java.\n\nThis library simplifies the process of managing Docker containers during testing, making it easier to ensure a consistent and isolated environment for each test. It supports a wide range of containers, including databases, message queues, and web servers.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add testcontainers\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install testcontainers\n\n## Usage\n\nTo use Testcontainers in your tests, first create and start a container in your test setup. For example, to run a Redis container:\n\n```ruby\ncontainer = Testcontainers::DockerContainer.new(\"redis:6.2-alpine\").with_exposed_port(6379)\ncontainer.start\n```\n\n\n\nIn your tests, you can now access the container's host and mapped port:\n\n```ruby\nhost = container.host\nport = container.mapped_port(6379)\n```\n\n\n\nThis allows you to connect to the containerized service and perform your tests. After running your tests, you can stop and delete the container:\n\n\n```ruby\ncontainer.stop\ncontainer.delete\n```\n\nFor a more detailed example, please refer to the Quickstart Guide under the docs folder.\n\n### Included modules\n\nTescontainers contains modules that can be used instead of the generic\nDockerContainer for common databases and services, providing\npre-configured setups and reducing the amount of boilerplate code:\n\n- [ComposeContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/compose)\n\n- [ElasticsearchContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/elasticsearch)\n\n- [MariadbContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/mariadb)\n\n- [MongoContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/mongo)\n\n- [MysqlContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/mysql)\n\n- [NginxContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/nginx)\n\n- [PostgresContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/postgres)\n\n- [RabbitmqContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/rabbitmq)\n\n- [RedisContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/redis)\n\n- [RedpandaContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/redpanda)\n\n- [SeleniumContainer](https://github.com/testcontainers/testcontainers-ruby/tree/main/selenium)\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/testcontainers/testcontainers-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/testcontainers/testcontainers-ruby/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Testcontainers project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/testcontainers/testcontainers-ruby/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestcontainers%2Ftestcontainers-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestcontainers%2Ftestcontainers-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestcontainers%2Ftestcontainers-ruby/lists"}