Add a configuration option for parse_with_nokogiri

This commit is contained in:
Bryan Helmkamp 2008-11-23 14:44:13 -05:00
parent 0d205e382b
commit 302f0dc1c6
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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