Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

specs fail a lot with ruby 1.9.1 #37

Closed
brainlag opened this Issue · 13 comments

3 participants

@brainlag

There are serveral problems with ruby 1.9.1
First it will not run any specs at all because instance vars are not allowed as block arguments

semantic_form_for(@new_post) do |@builder|
                                 ^

Im not sure if this is a typo or it makes any sense with ruby 1.8.6 because these appear only 2 times.

After fixing this nearly all specs fail because of missing methods errors.
The missing methods are all defined at line 43-51 in formtastic_spec.rb so I assume there is a scoping problem which I was unable to get around.

@justinfrench

Thanks, I don't have a multi-ruby environment set up right now, so I've tagged this with 1.0, which means I'll lok at it after 0.9 ships, assuming no one else has picked it up in the meantime.

@grimen

I managed to get the specs running with some trix, but it's quite hilarious:

F...FF........FFFFFFFFFFFFFFFFFFFFFF.FFFF.FFFFFFFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFF...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF..

I'm working on it now though. =) Weeee

@justinfrench

I couldn't even get them to run at all under 1.9.x, Rake kept complaining about the require spec/rake/spectask or whatever it is. So you're doing better than me!

@grimen

Yes, I learned how to solve such errors yesterday while fixing a very broken Rails plugin that I loved to use. Usually, you only have to declare which gem and version you are using like this:

require 'rubygems'

gem 'nokogiri', '>= 1.0.0'

# now, require libs here...

I'm trying to fix the bad bad RSpec errors cuased by maybe too much meta-programming, because the estack trace is like greek. I started off with trying jruby first as a warm up, and managed to get from 18 errors to aprox 5. Most of em was because of invalid selector input to nokogiri which only works with an old libxml2 version that is more whiny. Here you got the errors that I cannot touch now:

http://pastie.org/601101

...but look on error 2 and 3 - my eyes tells me those specs should not pass. Also , the last incorrect specs testing if classes for object id gets generated - but that is very invalid markup, so if that is used now maybe it should be designed in a valid way.

OK, back to the 1.9 debugging... =)

@grimen

Actually, the issue was that I used the newer rspec_hpricot_matchers (from github) that dropped hpricot for the faster and more robust nokogiri, which pointing out the invalid markup too. All specs works for jruby now with the older version of rspec_hpricot_matchers.

@grimen

Just to mention, I spent a pair of hours on this but never got any longer on the failing tests as ruby-debug is not supported for 1.9.1, and therefore very hard to debug (as I use to). =( It was worth a try though! The good news - maybe - is that it's the same error recurring all over the place.

@brainlag

Maybe you can give this version of ruby-debug a try, should work with ruby 1.9
http://github.com/mark-moseley/ruby-debug/tree/master

@grimen

OK, I'll try that. Thanks for the tip!

@grimen

Solved! =D

rake
(in /Users/Jonas/Development/forks/formtastic)
............................................................................................................................................................................................................................................................................................................................................................................................

Finished in 7.839581 seconds

380 examples, 0 failures

Quite trivial changes as soon as I got the big picture:
http://github.com/grimen/formtastic/commit/bd271597fc223e64a7f558ceb5306738987e1492

@brainlag

Great Work! Does it still work with ruby 1.8.x?

@grimen

Yes, I tested with 1.8.7 - so I'm like 99.9% sure 1.8.6 works too.

@justinfrench
Owner

Awesome work! I have 1.8.6 handy, so I'll pull this down and have a play.

@grimen

Justin, note that both last 2 commits are needed - the previous one got the specs start running.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.