tags:

views:

215

answers:

1

I'm running ruby 1.8.6.

I installed the minitest 1.3.1 gem, which is the new defacto replacement for the Test::Unit framework in Ruby 1.9 The API is supposed to be the same. I wrote a small test to get things rolling

require 'rubygems'
gem 'minitest'
require 'minitest/unit'

MiniTest::Unit.autorun

class CategoryMiniTest < MiniTest::Unit::TestCase
  def test_twoCategoriesCannotHaveSameName
    assert_equals(2,2)
  end
end

which leads to

>ruby test\unit\category_mini_test.rb
l:/ruby_home/lib/ruby/1.8/pathname.rb:709:in `relative_path_from': different prefix: "l:/" and "L:/Gishu/Ruby/Rails/ShowMeTheMoney" (ArgumentError)
        from l:/ruby_home/lib/ruby/gems/1.8/gems/minitest-1.3.1/lib/minitest/unit.rb:17

What gives ?

+1  A: 

I can't see anything wrong with your code. It looks almost exactly the same as the Ruby 1.8.6 & MiniTest example in my blog post: Test::Unit and MiniTest with different Ruby versions.

So I wonder if it is (a) something to do with your environment; (b) something to do with how you are running the test; or (c) a bug in MiniTest.

Looking at the error message, I wonder whether the problem is with case-sensitivity - the upper-case and lower-case L drive letters may not match.

floehopper
I'm running Win XP.. this seems to be an error that happens irrespective of minitest (I mean there are other instances online where the same error message is seen in the trace).. Is there any way to explicitly set the path ?
Gishu
I tried running it from the command line with the ruby interpreter as well as by running rake (from a rails project). Both give the same error
Gishu