{"id":13835694,"url":"https://github.com/ruby/spec","last_synced_at":"2025-12-16T20:15:52.403Z","repository":{"id":482199,"uuid":"107872","full_name":"ruby/spec","owner":"ruby","description":"The Ruby Spec Suite aka ruby/spec","archived":false,"fork":false,"pushed_at":"2025-04-03T17:04:19.000Z","size":24330,"stargazers_count":608,"open_issues_count":30,"forks_count":388,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-04-12T01:53:35.968Z","etag":null,"topics":["hacktoberfest","language-specs","mspec","ruby","rubyspec","test-suite"],"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/ruby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security/cve_2010_1330_spec.rb","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["eregon"]}},"created_at":"2009-01-15T08:19:09.000Z","updated_at":"2025-04-09T07:37:15.000Z","dependencies_parsed_at":"2023-09-25T13:48:18.919Z","dependency_job_id":"a6ec690d-0873-4b3f-ac4e-9fb5f0e5a3af","html_url":"https://github.com/ruby/spec","commit_stats":{"total_commits":14255,"total_committers":584,"mean_commits":"24.409246575342465","dds":0.7963521571378464,"last_synced_commit":"8fc6729a12bba785ceff7944dc694adca8817a2e"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby","download_url":"https://codeload.github.com/ruby/spec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505873,"owners_count":21115354,"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":["hacktoberfest","language-specs","mspec","ruby","rubyspec","test-suite"],"created_at":"2024-08-04T14:01:09.641Z","updated_at":"2025-12-16T20:15:52.326Z","avatar_url":"https://github.com/ruby.png","language":"Ruby","readme":"# The Ruby Spec Suite\n\n[![Actions Build Status](https://github.com/ruby/spec/workflows/CI/badge.svg)](https://github.com/ruby/spec/actions)\n\nThe Ruby Spec Suite, abbreviated `ruby/spec`, is a test suite for the behavior of the Ruby programming language.\n\n### Description and Motivation\n\nIt is not a standardized specification like the ISO one, and does not aim to become one.\nInstead, it is a practical tool to describe and test the behavior of Ruby with code.\n\nEvery example code has a textual description, which presents several advantages:\n\n* It is easier to understand the intent of the author\n* It documents how recent versions of Ruby should behave\n* It helps Ruby implementations to agree on a common behavior\n\nThe specs are written with syntax similar to RSpec 2.\nThey are run with MSpec, the purpose-built framework for running the Ruby Spec Suite.\nFor more information, see the [MSpec](https://github.com/ruby/mspec) project.\n\nThe specs describe the [language syntax](language/), the [core library](core/), the [standard library](library/), the [C API for extensions](optional/capi) and the [command line flags](command_line/).\nThe language specs are grouped by keyword while the core and standard library specs are grouped by class and method.\n\nruby/spec is known to be tested in these implementations for every commit:\n\n* [MRI](https://rubyci.org/) on 30 platforms and 4 versions\n* [JRuby](https://github.com/jruby/jruby/tree/master/spec/ruby) for both 1.7 and 9.x\n* [TruffleRuby](https://github.com/oracle/truffleruby/tree/master/spec/ruby)\n* [Opal](https://github.com/opal/opal/tree/master/spec)\n* [Artichoke](https://github.com/artichoke/spec/tree/artichoke-vendor)\n\nruby/spec describes the behavior of Ruby 3.2 and more recent Ruby versions.\nMore precisely, every latest stable MRI release should [pass](https://github.com/ruby/spec/actions/workflows/ci.yml) all specs of ruby/spec (3.2.x, 3.3.x, etc), and those are tested in CI.\n\n### Synchronization with Ruby Implementations\n\nThe specs are synchronized both ways around once a month by @andrykonchin between ruby/spec, MRI, JRuby and TruffleRuby,\nusing [this script](https://github.com/ruby/mspec/blob/master/tool/sync/sync-rubyspec.rb).\nEach of these repositories has a full copy of the specs under `spec/ruby` to ease editing specs.\nAny of these repositories can be used to add or edit specs, use what is most convenient for you.\n\nFor *testing* the development version of a Ruby implementation, one should always test against that implementation's copy of the specs under `spec/ruby`, as that's what the Ruby implementation tests against in their CI.\nAlso, this repository doesn't always contain the latest spec changes from MRI (it's synchronized monthly), and does not contain tags (specs marked as failing on that Ruby implementation).\nRunning specs on a Ruby implementation can be done with:\n\n```console\n$ cd ruby_implementation/spec/ruby\n# Add ../ruby_implementation/bin in PATH, or pass -t /path/to/bin/ruby\n$ ../mspec/bin/mspec\n```\n\n### Specs for old Ruby versions\n\nFor older specs try these commits:\n\n* Ruby 2.0.0-p647 - [Suite](https://github.com/ruby/spec/commit/245862558761d5abc676843ef74f86c9bcc8ea8d) using [MSpec](https://github.com/ruby/mspec/commit/f90efa068791064f955de7a843e96e2d7d3041c2) (may encounter 2 failures)\n* Ruby 2.1.9 - [Suite](https://github.com/ruby/spec/commit/f029e65241374386077ac500add557ae65069b55) using [MSpec](https://github.com/ruby/mspec/commit/55568ea3918c6380e64db8c567d732fa5781efed)\n* Ruby 2.2.10 - [Suite](https://github.com/ruby/spec/commit/cbaa0e412270c944df0c2532fc500c920dba0e92) using [MSpec](https://github.com/ruby/mspec/commit/d84d7668449e96856c5f6bac8cb1526b6d357ce3)\n* Ruby 2.3.8 - [Suite](https://github.com/ruby/spec/commit/dc733114d8ae66a3368ba3a98422c50147a76ba5) using [MSpec](https://github.com/ruby/mspec/commit/4599bc195fb109f2a482a01c32a7d659518369ea)\n* Ruby 2.4.10 - [Suite](https://github.com/ruby/spec/commit/bce4f2b81d6c31db67cf4d023a0625ceadde59bd) using [MSpec](https://github.com/ruby/mspec/commit/e7eb8aa4c26495b7b461e687d950b96eb08b3ff2)\n* Ruby 2.5.9 - [Suite](https://github.com/ruby/spec/commit/c503335d3d9f6ec6ef24de60a0716c34af69b64f) using [MSpec](https://github.com/ruby/mspec/commit/0091e8a62e954717cd54641f935eaf1403692041)\n* Ruby 2.6.10 - [Suite](https://github.com/ruby/spec/commit/aaf998fb8c92c4e63ad423a2e7ca6e6921818c6e) using [MSpec](https://github.com/ruby/mspec/commit/5e36c684e9e2b92b1187589bba1df22c640a8661)\n* Ruby 2.7.8 - [Suite](https://github.com/ruby/spec/commit/93787e6035c925b593a9c0c6fb0e7e07a6f1df1f) using [MSpec](https://github.com/ruby/mspec/commit/1d8cf64722d8a7529f7cd205be5f16a89b7a67fd)\n* Ruby 3.0.7 - [Suite](https://github.com/ruby/spec/commit/affef93d9940f615e4836f64b011da211f570913) using [MSpec](https://github.com/ruby/mspec/commit/0aabb3e548eb5ea6cad0125f8f46cee34542b6b7)\n* Ruby 3.1.6 - [Suite](https://github.com/ruby/spec/commit/ec960f2389d1c2265d32397fa8afa6d462014efc) using [MSpec](https://github.com/ruby/mspec/commit/484310dbed35b84c74484fd674602f88c42d063a)\n\n### Running the specs\n\nFirst, clone this repository:\n\n    $ git clone https://github.com/ruby/spec.git\n\nThen move to it:\n\n    $ cd spec\n\nClone [MSpec](https://github.com/ruby/mspec):\n\n    $ git clone https://github.com/ruby/mspec.git ../mspec\n\nAnd run the spec suite:\n\n    $ ../mspec/bin/mspec\n\nThis will execute all the specs using the executable named `ruby` on your current PATH.\n\n### Running Specs with a Specific Ruby Implementation\n\nUse the `-t` option to specify the Ruby implementation with which to run the specs.\nThe argument is either a full path to the Ruby binary, or an executable in `$PATH`.\n\n    $ ../mspec/bin/mspec -t /path/to/some/bin/ruby\n\n### Running Selected Specs\n\nTo run a single spec file, pass the filename to `mspec`:\n\n    $ ../mspec/bin/mspec core/kernel/kind_of_spec.rb\n\nYou can also pass a directory, in which case all specs in that directories will be run:\n\n    $ ../mspec/bin/mspec core/kernel\n\nFinally, you can also run them per group as defined in `default.mspec`.\nThe following command will run all language specs:\n\n    $ ../mspec/bin/mspec :language\n\nIn similar fashion, the following commands run the respective specs:\n\n    $ ../mspec/bin/mspec :core\n    $ ../mspec/bin/mspec :library\n    $ ../mspec/bin/mspec :capi\n\n### Sanity Checks When Running Specs\n\nA number of checks for various kind of \"leaks\" (file descriptors, temporary files,\nthreads, subprocesses, `ENV`, `ARGV`, global encodings, top-level constants) can be\nenabled with `CHECK_LEAKS=true`:\n\n    $ CHECK_LEAKS=true ../mspec/bin/mspec\n\nNew top-level constants should only be introduced when needed or follow the\npattern `\u003cClassBeingTested\u003eSpecs` such as `module StringSpecs`.\nOther constants used for testing should be nested under such a module.\n\nExceptions to these rules are contained in the file `.mspec.constants`.\nMSpec can automatically add new top-level constants in this file with:\n\n    $ CHECK_LEAKS=save mspec ../mspec/bin/mspec file\n\n### Running Specs on S390x CPU Architecture\n\nRun the specs with `DFLTCC=0` if you see failing specs related to the zlib library on s390x CPU architecture. The failures can happen with the zlib library applying the patch madler/zlib#410 to enable the deflate algorithm producing a different compressed byte stream.\n\n    $ DFLTCC=0 ../mspec/bin/mspec\n\n### Contributing and Writing Specs\n\nSee [CONTRIBUTING.md](https://github.com/ruby/spec/blob/master/CONTRIBUTING.md) for documentation about contributing and writing specs (guards, matchers, etc).\n\n### Dependencies\n\nThese command-line executables are needed to run the specs.\n\n* `echo`\n* `stat` for `core/file/*time_spec.rb`\n* `find` for `core/file/fixtures/file_types.rb` (package `findutils`, not needed on Windows)\n\nThe file `/etc/services` is required for socket specs (package `netbase` on Debian, not needed on Windows).\n\n### Socket specs from rubysl-socket\n\nMost specs under `library/socket` were imported from the rubysl-socket project (which is no longer on GitHub).\nThe 3 copyright holders of rubysl-socket, Yorick Peterse, Chuck Remes and\nBrian Shirai, agreed to relicense those specs under the MIT license in ruby/spec.\n\n### History and RubySpec\n\nThis project was originally born from [Rubinius](https://github.com/rubinius/rubinius) tests being converted to the spec style.\nThe revision history of these specs is available [here](https://github.com/ruby/spec/blob/2b886623/CHANGES.before-2008-05-10).\nThese specs were later extracted to their own project, RubySpec, with a specific vision and principles.\nAt the end of 2014, Brian Shirai, the creator of RubySpec, decided to [end RubySpec](http://rubinius.com/2014/12/31/matz-s-ruby-developers-don-t-use-rubyspec/).\nA couple months later, the different repositories were merged and [the project was revived](https://eregon.github.io/rubyspec/2015/07/29/rubyspec-is-reborn.html).\nOn 12 January 2016, the name was changed to \"The Ruby Spec Suite\" for clarity and to let the RubySpec ideology rest in peace.\n","funding_links":["https://github.com/sponsors/eregon"],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby%2Fspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fspec/lists"}