Ruby 1.9 Issues
There are two main problems running the specs on Ruby 1.9:
- Ruby 1.9 changes language features and many core library methods.
- Potential bugs in Ruby 1.9
The RubySpecs were initially written for Ruby 1.8. Many of the specs work fine with 1.9. However, many of the specs fail on 1.9 because the specs need to be updated. To facilitate the process of updating the specs for 1.9, tags for failures have been added to the RubySpec source.
MSpec provides a special runner script that will read the tags and NOT run specs that fail. You can also exclude tagged specs with the default runner script.
Specs are tagged with 'fails' and 'critical'. Specs tagged as critical are specs that either cause hangs or segfaults.
To run all the specs but exclude failing ones:
$ cd rubyspec $ mspec ci -tr19
To run specs but exclude a particular tag:
$ mspec -tr19 -G critical $ mspec -tr19 -G fails $ mspec -tr19 -G critical -G fails
To run only the specs with a particular tag:
$ mspec -tr19 -g critical $ mspec -tr19 -g fails core/array
Listing tagged specs
To see the descriptions of all the specs tagged:
$ mspec tag --list-all $ mspec tag --list critical $ mspec tag --list fails
Removing tags
Once the specs have been updated, or bugs fixed in Ruby 1.9, the tags can be removed.
$ mspec tag --del fails core/array/append_spec.rb
When removing tags, it is usually best to give the specific file to process.
HEAD version of 1.9
Since there are so many changes being made to Ruby 1.9 while the issues are being worked out, the HEAD version of Ruby 1.9 should be used when updating the specs for 1.9.
Also, when adding ruby_version_is guards, the version should be set to "1.9". For example:
ruby_version_is "" ... "1.9" do
it "does something on versions prior to 1.9" do
# ...
end
end
ruby_version_is "1.9" do
it "does something on 1.9" do
# ...
end
end
Using ruby_bug guards for 1.9
The ruby_bug guard should not be used for any version of 1.9 until 1.9.2 official is released.
