[Ironruby-core] Cucumber / RSpec Story Runner

Jim Deville jdeville at microsoft.com
Tue Oct 21 23:13:20 EDT 2008


John:
The reason for ActiveSupport not being defined may have been due to the search path, but throwing an error on defined? Foo::Foo is a bug in our implementation. The bug is more of the problem in this case. RSpec is trying to use ActiveSupport if it's already loaded, or load its own copy of the Inflector library.

Orion:
Were you wanting to patch the ExtensionAttribute thing? Or something with the Merlin and Main folders. The former just needs to be corrected by us (we already have it, it just needs some changes to our scripts), the latter is something we could probably take a patch for.
JD

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (IRONRUBY)
Sent: Tuesday, October 21, 2008 8:06 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner

Sorry -the transform script that strips internal layout details from our .csproj files hasn't been updated to support the ExtensionAttribute project yet.

If you do rake compile from the command prompt it will build correctly.

I suspect that your problem with ActiveSupport has to do with the fact that we're not searching your local gems path for IronRuby (it's based off of the RUBY_ENGINE constant which means that it will look under a different set of paths.

Since we haven't gotten gem install to work correctly yet, we've been hacking things to work with an existing MRI installation and pulling gems out of that path instead. If you add these lines to the first file that runs (and before require 'rubygems'), things should just work:

RUBY_ENGINE = 'ruby'

Thanks,
-John

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards
Sent: Tuesday, October 21, 2008 7:18 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Cucumber / RSpec Story Runner

Built a release version, and it takes 1.769418 seconds, which is a fair improvement from 2.07

congrats on getting this far!

PS: The painful mess that you have to go through regarding Microsoft.Scripting.ExtensionAttribute.dll and littering the C drive with Merlin and Main folders is a bit uncool :-(
Is this kind of thing an area you will accept patches for?

Orion Edwards wrote:
I just ran rspec 1.1.9 (straight from github) on IronRuby build 167, and it appears to work (I only have a simple test, but hey).

I only had to make 2 changes:

rspec\lib\spec\extensions\main.rb:26 is

args.last[:spec_path] = File.expand_path(caller(0)[1])


IronRuby still doesn't seem to handle caller quite the same as MRI. I have no idea what that code is for, but I replaced it with this as a quick hack

args.last[:spec_path] = "."



and it seemed to work.
I encountered another problem using the 'have' matcher - rspec does this

if inflector = (defined?(ActiveSupport::Inflector) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil))


IronRuby throws uninitialized constant Object::ActiveSupport, whereas MRI just returns nil - it looks like IR isn't handling defined? on nested things properly yet.

To work around this I just put

module ActiveSupport; end


at the top of my ruby file to get around the nested module issue.

And presto!

C:\development\irtest>ir rspectest.rb

.



Finished in 2.072133 seconds



1 example, 0 failures



C:\development\irtest>ruby rspectest.rb

.



Finished in 0.053 seconds



1 example, 0 failures




The only problem now is that 2.07 seconds is somewhat larger than 0.053... I am using the debug build of ir though, as that's what rake:compile seems to give me.

Just playing with VS now to see if I can build a release version and try that

Ben Hall wrote:

Hi,



To get rspec to work you will need to modify the actual Ironruby

source.  I've raised bugs to get the changes required fixed, however I

did this based on 1.1.4, I think Cucumber will have a whole load more

bugs attached as it has more dependencies.



I know for a fact you won't be able to run Cucumber unmodified due to

existing bugs around gems.  (for example, gem needing .rb at the end

of the file to be able to find it)



However, I haven't had chance to take a closer look.



Ben







On Fri, Oct 17, 2008 at 2:53 PM, Curt Hagenlocher <curth at microsoft.com><mailto:curth at microsoft.com> wrote:



If you explicitly set the GEM_PATH before requiring gems, you should be able to use gems that are already present.  I haven't tried any other gem operations.



I assume you're running with the latest source?



-----Original Message-----

From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Pat Gannon

Sent: Friday, October 17, 2008 1:30 AM

To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org>

Subject: [Ironruby-core] Cucumber / RSpec Story Runner



Has anyone tried to get Cucumber (or it's predecessor: the RSpec story

runner) to work with IronRuby?  I have not had any luck thus far (I am

extremely new to Ruby), and I would really like to be able to use

Cucumber to write executable feature documentation for my .NET code.



http://github.com/aslakhellesoy/cucumber/wikis



I copied it under the "lib" directory, as well as several of its

dependencies, but when I try to do "require

'cucumber-0.1.7/lib/cucumber'", ir (interactive ruby) fails with a stack

overflow.  The same thing happens when I try to require some its

dependencies manually (eg. "require 'hoe-1.8.0/lib/hoe'" and "require

'rake-0.8.3/lib/rake'"), but some work just fine (eg. "require

'polyglot-0.2.3/lib/polyglot'" and "require

'treetop-1.2.4/lib/treetop'").



I also tried to get gem working to aide me in this process, but I had

problems with that too.  Has anyone got gem working with IronRuby?



Thanks in advance!

Pat Gannon

--

Posted via http://www.ruby-forum.com/.

_______________________________________________

Ironruby-core mailing list

Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org>

http://rubyforge.org/mailman/listinfo/ironruby-core



_______________________________________________

Ironruby-core mailing list

Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org>

http://rubyforge.org/mailman/listinfo/ironruby-core





_______________________________________________

Ironruby-core mailing list

Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org>

http://rubyforge.org/mailman/listinfo/ironruby-core



--
Orion Edwards
Web Application Developer

T: +64 7 859 2120
F: +64 7 859 2320
E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com>

Open2view.com
The Real Estate Website

[cid:image001.jpg at 01C933B9.7636F7D0]










________________________________










_______________________________________________

Ironruby-core mailing list

Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org>

http://rubyforge.org/mailman/listinfo/ironruby-core



--
Orion Edwards
Web Application Developer

T: +64 7 859 2120
F: +64 7 859 2320
E: orion.edwards at open2view.com <mailto:orion.edwards at open2view.com>

Open2view.com
The Real Estate Website

[cid:image001.jpg at 01C933B9.7636F7D0]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/87196e01/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 8147 bytes
Desc: image001.jpg
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20081021/87196e01/attachment-0001.jpg>


More information about the Ironruby-core mailing list