3 MSpec is a specialized framework that is syntax-compatible with RSpec 2 for
4 basic things like `describe`, `it` blocks and `before`, `after` actions.
5 MSpec contains additional features that assist in writing specs for
6 Ruby implementations in [ruby/spec](https://github.com/ruby/spec).
8 MSpec attempts to use the simplest Ruby language features so that beginning
9 Ruby implementations can run the Ruby specs. For example, no file from the
10 standard library or RubyGems is necessary to run MSpec.
12 MSpec is not intended as a replacement for RSpec. MSpec attempts to provide a
13 subset of RSpec's features in some cases and a superset in others. It does not
14 provide all the matchers, for instance.
16 However, MSpec provides several extensions to facilitate writing the Ruby
17 specs in a manner compatible with multiple Ruby implementations.
19 1. MSpec offers a set of guards to control execution of the specs. These
20 guards not only enable or disable execution but also annotate the specs
21 with additional information about why they are run or not run.
23 2. MSpec provides a different shared spec implementation specifically
24 designed to ease writing specs for the numerous aliased methods in Ruby.
26 3. MSpec provides various helper methods to simplify some specs, for
27 example, creating temporary file names.
29 4. MSpec has several specialized runner scripts that includes a
30 configuration facility with a default project file and user-specific
33 5. MSpec support "tagging", that is excluding specs known as failing on
34 a particular Ruby implementation, and automatically adding and removing tags
35 while running the specs.
39 MSpec requires Ruby 2.6 or more recent.
43 A Gemfile is provided. Use Bundler to install gem dependencies. To install
44 Bundler, run the following:
50 To install the gem dependencies with Bundler, run the following:
53 ruby -S bundle install
58 Use RSpec to run the MSpec specs. There are no plans currently to make the
59 MSpec specs runnable by MSpec: https://github.com/ruby/mspec/issues/19.
61 After installing the gem dependencies, the specs can be run as follows:
64 ruby -S bundle exec rspec
67 To run an individual spec file, use the following example:
70 ruby -S bundle exec rspec spec/helpers/ruby_exe_spec.rb
75 See [CONTRIBUTING.md](https://github.com/ruby/spec/blob/master/CONTRIBUTING.md) in ruby/spec
76 for a list of matchers and how to use `mspec`.
80 See https://github.com/ruby/mspec
84 See the LICENSE in the source code.