All Projects → ruby → Spec

ruby / Spec

Licence: mit
The Ruby Spec Suite aka ruby/spec

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Spec

Check postgres
Nagios check_postgres plugin for checking status of PostgreSQL databases
Stars: ✭ 438 (-1.79%)
Mutual labels:  hacktoberfest
Awesome Indonesia Repo
A curated list of amazingly awesome repository created and contributed by Indonesian people.
Stars: ✭ 441 (-1.12%)
Mutual labels:  hacktoberfest
Laravel 8 Simple Cms
Laravel 8 content management system for starters.
Stars: ✭ 444 (-0.45%)
Mutual labels:  hacktoberfest
Quaternion
A Qt5-based IM client for Matrix
Stars: ✭ 438 (-1.79%)
Mutual labels:  hacktoberfest
React Flatpickr
flatpickr for React
Stars: ✭ 441 (-1.12%)
Mutual labels:  hacktoberfest
Jibri
Jitsi BRoadcasting Infrastructure
Stars: ✭ 442 (-0.9%)
Mutual labels:  hacktoberfest
Monk object detection
A one-stop repository for low-code easily-installable object detection pipelines.
Stars: ✭ 437 (-2.02%)
Mutual labels:  hacktoberfest
Socios Brasil
Captura os dados de sócios das empresas brasileiras na Receita Federal e exporta para um formato legível por humanos
Stars: ✭ 445 (-0.22%)
Mutual labels:  hacktoberfest
Appbox Iosappswirelessinstallation
AppBox is a tool for iOS developers to build and deploy Development, Ad-Hoc, and In-house (Enterprise) applications directly to the devices from your Dropbox account. Download latest version -
Stars: ✭ 441 (-1.12%)
Mutual labels:  hacktoberfest
Icons
Named, vector icons for elementary OS
Stars: ✭ 443 (-0.67%)
Mutual labels:  hacktoberfest
Express Openapi Validator
🦋 Auto-validates api requests, responses, and securities using ExpressJS and an OpenAPI 3.x specification
Stars: ✭ 436 (-2.24%)
Mutual labels:  hacktoberfest
Badge Poser
The PHP badges, renders some badges for your readme with the packagist information.
Stars: ✭ 440 (-1.35%)
Mutual labels:  hacktoberfest
Pdfvuer
A PDF viewer for Vue using Mozilla's PDF.js
Stars: ✭ 443 (-0.67%)
Mutual labels:  hacktoberfest
Matter
Customizable GRUB theme inspired by Material Design
Stars: ✭ 439 (-1.57%)
Mutual labels:  hacktoberfest
V Dashboard
Dashboard starter template built with Vue 3 and Tailwind CSS.
Stars: ✭ 438 (-1.79%)
Mutual labels:  hacktoberfest
Glorytun
Multipath UDP tunnel
Stars: ✭ 437 (-2.02%)
Mutual labels:  hacktoberfest
Ffuf
Fast web fuzzer written in Go
Stars: ✭ 5,687 (+1175.11%)
Mutual labels:  hacktoberfest
Rlbot
A framework that allows people to write their own Rocket League bots.
Stars: ✭ 445 (-0.22%)
Mutual labels:  hacktoberfest
Nrfmicro
Pro Micro-compatible Bluetooth 5.2 board with Li-Po charger and USB-C (nRF52840-based)
Stars: ✭ 444 (-0.45%)
Mutual labels:  hacktoberfest
Composition Api
Composition API hooks for Nuxt.
Stars: ✭ 441 (-1.12%)
Mutual labels:  hacktoberfest

The Ruby Spec Suite

Actions Build Status Gitter

The Ruby Spec Suite, abbreviated ruby/spec, is a test suite for the behavior of the Ruby programming language.

Description and Motivation

It is not a standardized specification like the ISO one, and does not aim to become one. Instead, it is a practical tool to describe and test the behavior of Ruby with code.

Every example code has a textual description, which presents several advantages:

  • It is easier to understand the intent of the author
  • It documents how recent versions of Ruby should behave
  • It helps Ruby implementations to agree on a common behavior

The specs are written with syntax similar to RSpec 2. They are run with MSpec, the purpose-built framework for running the Ruby Spec Suite. For more information, see the MSpec project.

The specs describe the language syntax, the core library, the standard library, the C API for extensions and the command line flags. The language specs are grouped by keyword while the core and standard library specs are grouped by class and method.

ruby/spec is known to be tested in these implementations for every commit:

ruby/spec describes the behavior of Ruby 2.5 and more recent Ruby versions. More precisely, every latest stable MRI release should pass all specs of ruby/spec (2.5.x, 2.6.x, 2.7.x, etc), and those are tested in TravisCI.

Synchronization with Ruby Implementations

The specs are synchronized both ways around once a month by @eregon between ruby/spec, MRI, JRuby and TruffleRuby, using this script. Each of these repositories has a full copy of the specs under spec/ruby to ease editing specs. Any of these repositories can be used to add or edit specs, use what is most convenient for you.

For 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. Also, 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). Running specs on a Ruby implementation can be done with:

$ cd ruby_implementation/spec/ruby
# Add ../ruby_implementation/bin in PATH, or pass -t /path/to/bin/ruby
$ ../mspec/bin/mspec

Specs for old Ruby versions

For older specs try these commits:

Running the specs

First, clone this repository:

$ git clone https://github.com/ruby/spec.git

Then move to it:

$ cd spec

Clone MSpec:

$ git clone https://github.com/ruby/mspec.git ../mspec

And run the spec suite:

$ ../mspec/bin/mspec

This will execute all the specs using the executable named ruby on your current PATH.

Running Specs with a Specific Ruby Implementation

Use the -t option to specify the Ruby implementation with which to run the specs. The argument is either a full path to the Ruby binary, or an executable in $PATH.

$ ../mspec/bin/mspec -t /path/to/some/bin/ruby

Running Selected Specs

To run a single spec file, pass the filename to mspec:

$ ../mspec/bin/mspec core/kernel/kind_of_spec.rb

You can also pass a directory, in which case all specs in that directories will be run:

$ ../mspec/bin/mspec core/kernel

Finally, you can also run them per group as defined in default.mspec. The following command will run all language specs:

$ ../mspec/bin/mspec :language

In similar fashion, the following commands run the respective specs:

$ ../mspec/bin/mspec :core
$ ../mspec/bin/mspec :library
$ ../mspec/bin/mspec :capi

Sanity Checks When Running Specs

A number of checks for various kind of "leaks" (file descriptors, temporary files, threads, subprocesses, ENV, ARGV, global encodings, top-level constants) can be enabled with CHECK_LEAKS=true:

$ CHECK_LEAKS=true ../mspec/bin/mspec

New top-level constants should only be introduced when needed or follow the pattern <ClassBeingTested>Specs such as module StringSpecs. Other constants used for testing should be nested under such a module.

Exceptions to these rules are contained in the file .mspec.constants. MSpec can automatically add new top-level constants in this file with:

$ CHECK_LEAKS=save mspec ../mspec/bin/mspec file

Contributing and Writing Specs

See CONTRIBUTING.md for documentation about contributing and writing specs (guards, matchers, etc).

Dependencies

These command-line executables are needed to run the specs.

  • echo
  • stat for core/file/*time_spec.rb
  • find for core/file/fixtures/file_types.rb (package findutils, not needed on Windows)

The file /etc/services is required for socket specs (package netbase on Debian, not needed on Windows).

Socket specs from rubysl-socket

Most specs under library/socket were imported from the rubysl-socket project. The 3 copyright holders of rubysl-socket, Yorick Peterse, Chuck Remes and Brian Shirai, agreed to relicense those specs under the MIT license in ruby/spec.

History and RubySpec

This project was originally born from Rubinius tests being converted to the spec style. The revision history of these specs is available here. These specs were later extracted to their own project, RubySpec, with a specific vision and principles. At the end of 2014, Brian Shirai, the creator of RubySpec, decided to end RubySpec. A couple months later, the different repositories were merged and the project was revived. On 12 January 2016, the name was changed to "The Ruby Spec Suite" for clarity and to let the RubySpec ideology rest in peace.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].