Hi, I'm working with mechanize and having problems with inheritance when testing in a rails environment, using script/console.
When I write like this:
require 'rubygems'
require 'mechanize'
agent = WWW::Mechanize.new
agent.get 'http://www.google.com'
Everything works fine. But when I try to create a subclass of WWW::Mechanize like this:
require 'rubygems'
require 'mechanize'
class Alfa < WWW::Mechanize; end
agent = Alfa.new
agent.get 'http://www.google.com'
I get the following error:
NoMethodError: You have a nil object when you didn't expect it! The error occurred while evaluating nil.parse from /Library/Ruby/Gems/1.8/gems/mechanize-0.9.3/lib/www/mechanize/page.rb:77:in `parser'
Am I missing something?
Thanks in advance