Add a configuration option for parse_with_nokogiri
This commit is contained in:
parent
0d205e382b
commit
302f0dc1c6
@ -12,6 +12,7 @@ module Webrat
|
|||||||
end
|
end
|
||||||
|
|
||||||
class Configuration
|
class Configuration
|
||||||
|
attr_accessor :parse_with_nokogiri
|
||||||
|
|
||||||
attr_accessor :mode
|
attr_accessor :mode
|
||||||
|
|
||||||
@ -20,6 +21,7 @@ module Webrat
|
|||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
self.open_error_files = true
|
self.open_error_files = true
|
||||||
|
self.parse_with_nokogiri = true
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -9,6 +9,15 @@ describe Webrat::Configuration do
|
|||||||
Webrat.reset_for_test
|
Webrat.reset_for_test
|
||||||
end
|
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
|
it "should open error files by default" do
|
||||||
config = Webrat.configuration
|
config = Webrat.configuration
|
||||||
config.open_error_files.should == true
|
config.open_error_files.should == true
|
||||||
|
Loading…
Reference in New Issue
Block a user