Coder Social home page Coder Social logo

spec's Introduction

The Ruby Spec Suite

Build Status Build Status

The Ruby Spec Suite is a test suite for the behavior of the Ruby programming language.

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:

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 may be a full path to the Ruby binary.

$ ../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

Contributing

See CONTRIBUTING.md.

History and RubySpec

This project was originally born from Rubinius tests being converted to the spec style. 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.

spec's People

Contributors

akr avatar alloy avatar arthurschreiber avatar banzaiman avatar brixen avatar calavera avatar chrisseaton avatar dbussink avatar drbrain avatar eregon avatar evanphx avatar febuiles avatar headius avatar hsbt avatar jfirebaugh avatar jredville avatar kachick avatar mame avatar marcandre avatar mernen avatar nobu avatar nurse avatar razielgn avatar runpaint avatar ryoqun avatar ujihisa avatar vais avatar vvs avatar wied03 avatar yugui avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.