Hi.
I happily hand-compiled Ruby 1.9.0-0 into /home/shot/opt/ruby today
and I’m running into a strange error with RSpec – all my examples work
perfectly with Ruby 1.8 but are considered peding on Ruby 1.9.
My setups:
a) Ubuntu-packaged Ruby 1.8.6p36 (ruby1.8 1.8.6.36-1ubuntu3),
RubyGems 1.0.1 (rubygems 1.0.1-3) and RSpec 1.1.1 (in /var/lib/gems/1.8)
b) source-compiled Ruby 1.9.0-0 and RSpec 1.1.1
(in /home/shot/opt/ruby/lib/ruby/gems/1.9.0)
Now for the examples (two scenarios, both
with fresh shell, so the same original $PATH):
a)
[email protected]:~/work/PhD/bzr/trunk$ export
PATH=/var/lib/gems/1.8/bin:$PATH
[email protected]:~/work/PhD/bzr/trunk$ spec spec/architecture_spec.rb
…
Finished in 0.00815 seconds
3 examples, 0 failures
b)
[email protected]:~/work/PhD/bzr/trunk$ export
PATH=/home/shot/opt/ruby/bin:$PATH
[email protected]:~/work/PhD/bzr/trunk$ spec spec/architecture_spec.rb
PPP
Pending:
ArtDecomp::Architecture before(:all) (Not Yet Implemented)
ArtDecomp::Architecture before(:all) (Not Yet Implemented)
ArtDecomp::Architecture before(:all) (Not Yet Implemented)
Finished in 0.012114249 seconds
3 examples, 0 failures, 3 pending
How can I bugtrack/fix this?
I had to patch RSpec in the below manner to get it running
on Ruby 1.9, but I doubt these fixes can be the culprit.
— lib/spec/runner/options.rb.orig 2007-12-27 16:36:03.000000000
+0100
+++ lib/spec/runner/options.rb 2007-12-27 16:36:28.000000000 +0100
@@ -102,7 +102,7 @@
def colour=(colour)
@colour = colour
begin; \
-
require 'Win32/Console/ANSI' if @colour && PLATFORM =~
/win32/;
+# require ‘Win32/Console/ANSI’ if @colour && PLATFORM =~
/win32/;
rescue LoadError ;
raise “You must gem install win32console to use colour on
Windows” ;
end
— lib/spec/matchers/be.rb.orig 2007-12-27 16:30:51.000000000
+0100
+++ lib/spec/matchers/be.rb 2007-12-27 16:32:14.000000000 +0100
@@ -124,7 +124,8 @@
def parse_expected(expected)
if Symbol === expected
@handling_predicate = true
-
["be_an_","be_a_","be_"].each do |@prefix|
-
["be_an_","be_a_","be_"].each do |at_prefix|
-
@prefix = at_prefix if expected.starts_with?(@prefix) return "#{expected.to_s.sub(@prefix,"")}".to_sym end
– Shot