diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-03-10 12:08:42 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-03-10 12:08:42 -0700 |
commit | 37cf224fdb7259c139450bc33c68ec09489be9c2 (patch) | |
tree | 4e207ec7fd5a934ab02a21c8c4b25598781e4e6f /activesupport/test/xml_mini/nokogiri_engine_test.rb | |
parent | 694998ee4fb8d257ba78424cab630846327a0889 (diff) | |
download | rails-37cf224fdb7259c139450bc33c68ec09489be9c2.tar.gz rails-37cf224fdb7259c139450bc33c68ec09489be9c2.tar.bz2 rails-37cf224fdb7259c139450bc33c68ec09489be9c2.zip |
Make it easier to swap XmlMini backends. Require Nokogiri >= 1.1.1 for XmlMini backend tests.
Diffstat (limited to 'activesupport/test/xml_mini/nokogiri_engine_test.rb')
-rw-r--r-- | activesupport/test/xml_mini/nokogiri_engine_test.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/activesupport/test/xml_mini/nokogiri_engine_test.rb b/activesupport/test/xml_mini/nokogiri_engine_test.rb index 5c4002d34e..1ab36785ac 100644 --- a/activesupport/test/xml_mini/nokogiri_engine_test.rb +++ b/activesupport/test/xml_mini/nokogiri_engine_test.rb @@ -1,8 +1,11 @@ require 'abstract_unit' require 'active_support/xml_mini' - begin + gem 'nokogiri', '>= 1.1.1' +rescue Gem::LoadError + # Skip nokogiri tests +else require 'nokogiri' @@ -10,7 +13,7 @@ class NokogiriEngineTest < Test::Unit::TestCase include ActiveSupport def setup - @default_backend = XmlMini.backend.to_s.split('_').last + @default_backend = XmlMini.backend XmlMini.backend = 'Nokogiri' end @@ -99,14 +102,9 @@ class NokogiriEngineTest < Test::Unit::TestCase private def assert_equal_rexml(xml) - XmlMini.backend = 'REXML' - hash = XmlMini.parse(xml) - - XmlMini.backend = 'Nokogiri' - + hash = XmlMini.with_backend('REXML') { XmlMini.parse(xml) } assert_equal(hash, XmlMini.parse(xml)) end end -rescue LoadError - # Yay, no errors + end |