Skip to content
This repository

Executable specification for the Ruby programming language.

branch: master

Removed Kernel#caller specs.

Every implementation uses significantly different methods to implement calling
methods. In MRI, numerous actual frames are invisible because they are in C,
while in Rubinius, these frames are in Ruby and are visible.

It's not realistic or useful to attempt to specify the results of caller.
Further, it's a hack in the first place and a proper object-oriented API for
querying the stack should be created.
latest commit 642bf529e9
Brian Shirai brixen authored
Octocat-spinner-32 command_line Removed ruby_version_is from command line specs. April 07, 2014
Octocat-spinner-32 core Removed Kernel#caller specs. April 08, 2014
Octocat-spinner-32 fixtures Added spec for #require of .rb vs .<dlext>. April 04, 2014
Octocat-spinner-32 language Fixed description for zsuper in define_method method. April 08, 2014
Octocat-spinner-32 nbproject Add command_line dir to Netbeans project January 14, 2010
Octocat-spinner-32 optional Removed ruby_version is from C-API specs. April 06, 2014
Octocat-spinner-32 shared Updated specs for method_missing. April 08, 2014
Octocat-spinner-32 tags Removed all tags for 1.9 because it has stabilized significantly. February 11, 2010
Octocat-spinner-32 .gitignore Update travis settings March 12, 2013
Octocat-spinner-32 .travis.yml Update .travis.yml. September 21, 2013
Octocat-spinner-32 CHANGES.before-2008-05-10 Un-rewrite history. [ci skip] February 22, 2013
Octocat-spinner-32 Gemfile Add configuration for building rubyspec on Travis CI on all supported… March 12, 2013
Octocat-spinner-32 LICENSE Update license info. May 17, 2008
Octocat-spinner-32 Fixed README. April 18, 2013
Octocat-spinner-32 TODO TODO: Remove completed items. September 05, 2009
Octocat-spinner-32 ruby.2.0.mspec Updated config files. October 21, 2013
Octocat-spinner-32 ruby.2.1.mspec Updated config files. October 21, 2013
Octocat-spinner-32 spec_helper.rb Require mspec version 1.5.17. March 13, 2010
Octocat-spinner-32 version.rb Update version to 0.7.6 and require mspec 1.5.12. June 08, 2009

RubySpec is an executable specification for the Ruby programming language. The specs describe Ruby language syntax as well as the core and standard library classes. See for more information.

The RubySpec files are written using RSpec-compatible syntax. MSpec is a purpose-built framework for running RubySpec. For more information, see the project.

Build Status

  1. Installing MSpec

The easiest way to run the RubySpecs suite is to install the MSpec gem.

$ [sudo] gem install mspec

Once the gem is installed, the 'mspec' executable will be available and all the commands shown below should run.

However, RubySpec often utilizes the latest MSpec features, so you may want to use MSpec directly from the Git repository.

$ cd /somewhere
$ git clone git://

MSpec is now available in '/somewhere/mspec'.

To make the MSpec scripts available, add the MSpec 'bin' directory to you PATH:

$ export PATH=/somewhere/mspec/bin:$PATH

Once you have MSpec installed, clone the RubySpec Git repository to run the specs.

$ cd /somewhere
$ git clone git://

To run the RubySpec suite:

$ cd /somewhere/rubyspec
$ mspec

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

  1. Running Specs with a Specific Ruby Interpreter

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. For example, to run RubySpec against '/opt/ruby-enterprise/bin/ruby':

$ mspec -t /opt/ruby-enterprise/bin/ruby

There are some arguments that are abbreviations for known Ruby implementations. For example, if you specify 'j', then MSpec will look for 'jruby' in PATH and run RubySpec against that:

$ mspec -t j

See 'mspec --help' for a list of '-t' abbreviations.

  1. Running Selected Specs

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

$ 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 core/kernel

Note however that passing a directory to MSpec may not always be a good idea, because some specs are language version specific. While there are version guards in the specs for version-specific behaviors, some classes and libraries are only for one Ruby version.

RubySpec provides configuration files that include or exclude some spec directories based on language version. MSpec provides an option to run these sets of specs. The sets are divided by the natural divisions in RubySpec.

The following command will run all core library specs specific to the language version:

$ mspec :core

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

$ mspec :library
$ mspec :language
Something went wrong with that request. Please try again.