[rspec-devel] [ rspec-Bugs-8155 ] rspec clashing with rubyclr

noreply at rubyforge.org noreply at rubyforge.org
Thu Jan 25 18:22:52 EST 2007

Bugs item #8155, was opened at 2007-01-25 22:39
You can respond by visiting: 

Category: expectation module
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Kevin Williams (kevwil)
Assigned to: Nobody (None)
Summary: rspec clashing with rubyclr

Initial Comment:
I'm running Ruby 1.8.5 on Windows XP SP2. I have RubyGems 0.9.1, rspec, and rubyclr 0.5.2. I have both .NET 1.1 and 2.0 installed on this box.

I don't know if this is due to rspec behavior or rubyclr behavior, so this may not be an rspec issue.

I'm trying to use rspec with .NET code. I've toyed with rubyclr before and it works. For example, the following prints out "count = 0":

require 'rubyclr'
include System::Collections
list = ArrayList.new
puts "count = #{list.Count}"

Now, when I try to do something similar using rspec, I get errors.


require 'rubyclr'
include System::Collections
context "An array list" do
  setup do
    @list = ArrayList.new
  specify "starts empty" do
    @list.Count.should == 0


C:\>spec arraylist_spec.rb -f s

An array list
- starts empty (ERROR - 1)

NoMethodError in 'An array list starts empty'
undefined method `ldc_i4' for #<Generator:0x3f94568>
./arraylist_spec.rb:5:in `new'

Finished in 0.141 seconds

1 specification, 1 failure

It appears to by trying to call a method (an overloaded constructor, I think) on a Generator object. It shouldn't be a Generator object as far as I know, so I thought perhaps this comes from rspec.


>Comment By: David Chelimsky (dchelimsky)
Date: 2007-01-25 23:22

I'm pretty sure this is not RSpec. We don't have any class named Generator. The stack trace you are seeing is trimmed down by RSpec. You can see the full trace doing this:

spec arraylist_spec.rb -fs -b

Does that help you see better where the problem might be?


You can respond by visiting: 

More information about the rspec-devel mailing list