diff --git a/lib/webrat/core/configuration.rb b/lib/webrat/core/configuration.rb index 8f8f049..f2241b2 100755 --- a/lib/webrat/core/configuration.rb +++ b/lib/webrat/core/configuration.rb @@ -12,6 +12,7 @@ module Webrat end class Configuration + attr_accessor :parse_with_nokogiri attr_accessor :mode @@ -20,6 +21,7 @@ module Webrat def initialize self.open_error_files = true + self.parse_with_nokogiri = true end end diff --git a/spec/webrat/core/configuration_spec.rb b/spec/webrat/core/configuration_spec.rb index fb9af6d..93ac03d 100755 --- a/spec/webrat/core/configuration_spec.rb +++ b/spec/webrat/core/configuration_spec.rb @@ -8,6 +8,15 @@ describe Webrat::Configuration do after do Webrat.reset_for_test end + + it "should have a mode" do + Webrat.configuration.should respond_to(:mode) + end + + it "should use Nokogiri as the parser by default" do + config = Webrat.configuration + config.parse_with_nokogiri.should == true + end it "should open error files by default" do config = Webrat.configuration