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

noreply at rubyforge.org noreply at rubyforge.org
Fri Jan 26 15:02:43 EST 2007


Bugs item #8155, was opened at 2007-01-25 15:39
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8155&group_id=797

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 0.7.5.1, 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.

__Code__:

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


__Error__:

C:\>spec arraylist_spec.rb -f s

An array list
- starts empty (ERROR - 1)

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

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: Kevin Williams (kevwil)
Date: 2007-01-26 13:02

Message:
Well, it doesn't help _me_ see the problem. :) I'll 
probably have to post this to the rubyclr team as well, but 
I know with John Lam moving to Seattle and starting that 
new brainwashing^H^H^H^H^H^H^H^H^H^H^H^H^Hjob, the rubyclr 
project is a bit dark these days. :(

(Just kidding, John.)

Here's the output:


C:\>spec arraylist_spec.rb -f s -b

An array list
- starts empty (ERROR - 1)

1)
NoMethodError in 'An array list starts empty'
undefined method `ldc_i4' for #<Generator:0x3f95f08>
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/expectations/sugar.rb:13:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/expectations/sugar.rb:13:in 
`_method_missing'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/expectations/sugar.rb:9:in `method_missing'
c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2-
mswin32/Src/Ruby/generate.rb:31:in `match_sig'
c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2-
mswin32/Src/Ruby/generate.rb:156:in `ctor_shim'
c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2-
mswin32/Src/Ruby/dynamicmethod.rb:63:in `instance_eval'

c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2-
mswin32/Src/Ruby/dynamicmethod.rb:63:in `core_create_sa
fe_ruby_method'
c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2-
mswin32/Src/Ruby/dynamicmethod.rb:48:in `core_create_ru
by_method'
c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2-
mswin32/Src/Ruby/dynamicmethod.rb:61:in `core_create_sa
fe_ruby_method'
c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2-
mswin32/Src/Ruby/dynamicmethod.rb:89:in `create_safe_ru
by_instance_method'
c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2-
mswin32/Src/Ruby/generate.rb:153:in `ctor_shim'
c:/ruby/lib/ruby/gems/1.8/gems/rubyclr-0.5.2-
mswin32/Src/Ruby/core.rb:21:in `initialize'
./arraylist_spec.rb:7:in `new'
./arraylist_spec.rb:7:
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/context_eval.rb:129:in 
`instance_eval'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/context_eval.rb:129:in 
`create_block_fr
om_parts'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/context_eval.rb:125:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/context_eval.rb:125:in 
`create_block_fr
om_parts'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/specification.rb:47:in 
`instance_eval'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/specification.rb:47:in `setup_spec'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/specification.rb:29:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/context.rb:57:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/context.rb:54:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/context.rb:54:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/context_runner.rb:23:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/context_runner.rb:22:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/context_runner.rb:22:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-
0.7.5.1/lib/spec/runner/command_line.rb:26:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rspec-0.7.5.1/bin/spec:4
c:/ruby/bin/spec:16:in `load'
c:/ruby/bin/spec:16

Finished in 0.157 seconds

1 specification, 1 failure

----------------------------------------------------------------------

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

Message:
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: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8155&group_id=797


More information about the rspec-devel mailing list