On Dec 29, 2007 7:44 AM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> On Dec 27, 2007 4:28 PM, Shot (Piotr Szotkowski) <[EMAIL PROTECTED]> wrote:
>
> > 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
> >
>
> The change to be.rb has already been applied, but not the change to
> options.rb. I'm not sure I see any relationship between that and
> problems you might be experiencing with 1.9 (unless win32console does
> not yet support 1.9). Feel free to submit a ticket to the tracker on
> this one.

David, will not be better set @colour back to false if the require
failed, instead of raising the exception?

In that way, colour is automatically disabled, the user warned and
when win32console gets updated for 1.9, all users will be happy :-D

-- 
Luis Lavena
Multimedia systems
-
A common mistake that people make when trying to design
something completely foolproof is to underestimate
the ingenuity of complete fools.
Douglas Adams
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to