Rubyspec

borland edited this page Oct 31, 2011 · 2 revisions

The Rubyspec tests are located in the Languages\Ruby\Tests\mspec\rubyspec folder.

To run the Rubyspec tests, these are the steps I followed

  • run dev.bat to launch a command prompt which has the right environment variables set up.
  • Navigate to the folder you want to run specs for (eg Languages\Ruby\Tests\mspec\rubyspec\core\symbol)
  • Run mspec . to run all the tests in that folder, or mspec some_file.rb to run tests in some_file.rb

The results should look something like this

ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
.........................................................................
....................................................................

Finished in 0.088005 seconds

19 files, 142 examples, 195 expectations, 0 failures, 0 errors
  • Notice the header line: ruby 1.9.2p0 (2010-08-18) [i386-mingw32]. This is telling you that the specs ran against MRI version 1.9.2, NOT against IronRuby. This is because mspec is set up to allow running tests under multiple ruby implementations, and the default is to run against MRI. A copy of MRI 1.9.2 is checked into the ironlanguages-main git repository (you can see it if you type where ruby.exe in your command prompt), and this is what the specs ran against.

  • To run against IronRuby, mspec looks for a RUBY environment variable, and defaults to ruby if it is not found. Enter the following at your command prompt:

    set RUBY=ir

  • Now run mspec . again.

You should now see something like this

IronRuby 1.1.4.0 on .NET 4.0.30319.239
.............................................F...........................
.......................................FF...........................
<bunch of exception messages>
Finished in 0.502029 seconds

19 files, 142 examples, 195 expectations, 3 failures, 0 errors
  • NOTE: If you have run the IronRuby installer on your PC, the tests will be run against the version of IronRuby that was installed into C:\Program Files(x86)\IronRuby 1.1 instead of the development copy. This is probably not what you want. You can check which version is running by typing where ir.exe. The first entry is the one that will be run.

To run against the dev build of IronRuby, either uninstall the IronRuby installer, or type the following:

set PATH=<path-to-ironlanguages-main>\bin\Debug;%PATH%

And then re-run mspec