Forum: IronRuby expand_path & Rspec

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Michael D. (Guest)
on 2009-03-27 15:50

I getting the expand path problem when trying to run some rspec
Ben H. mentioned it before.

I have a spec:
require File.dirname(__FILE__) + '/Domain.dll'
require 'rubygems'
require 'spec'

module ProductSpecHelper
  def valid_attributes
    { :Name => 'Test' }

describe Domain::Product, "When saving" do
  include ProductSpecHelper

  before(:each) do
    @product =

  it "should have a name" do
    @product.attributes = @valid_attributes be_nil
  it "should have product lines"


and run:

D:\IronRuby\RSpec>ir product_spec.rb
.cs:522:in `ExpandPath': Invalid argument - product_spec.rb:0
        from :0:in `expand_path'
        from example_group_methods.rb:108:in `set_description'
        from example_group_methods.rb:171:in `subclass'
        from example_group_methods.rb:48:in `describe'
        from example_group_factory.rb:25:in `create_example_group'
        from main.rb:22:in `describe'
        from product_spec.rb:0

Is there a work around people are using at the moment?
Tomas M. (Guest)
on 2009-03-27 18:45
(Received via mailing list)
Or would anyone like to contribute a better implementation of
expand_path? We know the current one is wrong and needs to rewritten.
This is an ideal opportunity (not only) for first time contributors -
it's an isolated piece of code, easy testable and you'll actually help
to fix something others care about!

Contribute today! :)

Michael D. (Guest)
on 2009-03-27 20:42
so its a bug then.
ok, i'll take a look at it.
any tips for a first time contributor ;-)
Shri B. (Guest)
on 2009-03-27 21:43
(Received via mailing list)
I fixed this particular issue. See attached. Its not in the main GIT
repo though.

The workaround for running the rubyspecs is to set HOME manually to
%USERPROFILE%. We are also fixing dev.bat to set HOME for you, so you
won't have to worry about it.

There are plenty of other tags (which disables a failing test) in
Delete anyone of them, run "mspec ci core\file" to see the test start
failing (since the tag is gone), and then work on a fix. Once you have
drilled into the issue a bit, I can help you as mentioned in the
attached email.
Tomas M. (Guest)
on 2009-03-27 21:58
(Received via mailing list)
There will be issues with expand_path as long as it uses
Path.GetFullPath and Path.Combine. These methods check for invalid path
characters while expand_path doesn't. So we need an implementation that
doesn't use Path.* methods.

Tomas M. (Guest)
on 2009-03-27 22:59
(Received via mailing list)
You'll find them here:

This topic is locked and can not be replied to.