Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nokogiri parse error when hijacking rails #9

Open
axs89 opened this issue Jul 27, 2011 · 7 comments
Open

Nokogiri parse error when hijacking rails #9

axs89 opened this issue Jul 27, 2011 · 7 comments

Comments

@axs89
Copy link

axs89 commented Jul 27, 2011

Hi-

I'm getting parse errors from cucumber / nokogiri (pretty much all tests failing), when trying to hijack rails and run deadweight with my cucumber test suite.

The environment is Rails 3.0.4, Ruby 1.9.2, Cucumber 1.0.2, capybara 1.0.0, nokogiri 1.4.4. I'm looking into it now, but thought I'd post in case there were any easy fixes I should look at:

unexpected '$' after 'DESCENDANT_SELECTOR' (Nokogiri::CSS::SyntaxError)
/Users/arun/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/racc/parser.rb:99:in `_racc_do_parse_c'
/Users/arun/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/racc/parser.rb:99:in `do_parse'
./features/step_definitions/web_steps.rb:20:in `/^(?:|I )am on (.+)$/'
features/registration/register_account.feature:26:in `Given I am on the registration page'
@axs89
Copy link
Author

axs89 commented Jul 27, 2011

Ok - so this has nothing to do with the hijacking of rails and the html output, it's actually breaking on my css. Trying to narrow this down.

@axs89
Copy link
Author

axs89 commented Jul 27, 2011

So I forked and added a begin / rescue that will basically recover (and skip) that selector if Nokogiri throws an exception. I was thinking of making this a bit more robust and collecting the in an @invalid_selectors array so that it would skip over them on subsequent tries, but not sure if this is the way that this issue should be handled?

@aanand
Copy link
Owner

aanand commented Aug 2, 2011

Sounds more or less sensible. Could you add tests for it please?

@axs89
Copy link
Author

axs89 commented Aug 3, 2011

definitely. I also need to tidy up some of my commits and then I'll create the pull request.

As a side note I've also added some stuff onto my fork to customize the hijack rails behavior for specific stylesheets, custom output stream, etc. It's pretty hack-y though, so I'd be interested in hearing how you were thinking about handling these issues in a more robust way.

@aanand
Copy link
Owner

aanand commented Aug 3, 2011

Rad.

You were probably already planning to do this, but if could you keep those two features (ignoring invalid selectors and improving hijack customisability) in separate branches, and submit them as separate pull requests, that'd be great.

Thanks for the interest, by the way! Don't work on DW much these days, so it's great to see it get some love.

On 3 Aug 2011, at 17:59, [email protected] wrote:

definitely. I also need to tidy up some of my commits and then I'll create the pull request.

As a side note I've also added some stuff onto my fork to customize the hijack rails behavior for specific stylesheets, custom output stream, etc. It's pretty hack-y though, so I'd be interested in hearing how you were thinking about handling these issues in a more robust way.

Reply to this email directly or view it on GitHub:
#9 (comment)

@deepak
Copy link

deepak commented Jan 1, 2013

+1. facing this issue as well

@switer
Copy link

switer commented Jan 10, 2013

error :
/ruby/gems/1.9.1/nokogiri-1.5.6-x86-mingw32/lib/nokogiri/css/parser_extras.rb:87
`on_error': unexpected '$' after 'DESCENDANT_SELECTOR' (Nokogiri::CSS::SyntaxError)

source line :

#sel :last-child {border-bottom: none;border-radius: 5px;}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants