test/unit/xml_hash_test.rb in roxml-3.3.1 vs test/unit/xml_hash_test.rb in roxml-4.0.0

- old
+ new

@@ -1,15 +1,16 @@ require_relative './../test_helper' +require 'minitest/autorun' class BookWithContributorHash include ROXML xml_reader :contributors, :as => {:key => '@role', :value => 'name'} end -class TestXMLHash < ActiveSupport::TestCase +class TestXMLHash < Minitest::Test def setup @contents = {'quaquaversally' => 'adjective: (of a geological formation) sloping downward from the center in all directions.', 'tergiversate' => 'To use evasions or ambiguities; equivocate.'} end @@ -24,22 +25,22 @@ assert_equal({'author' => 'David Thomas', 'supporting author' => ['Andrew Hunt', 'Chad Fowler']}, b.contributors) end def test_hash_with_object_key_fails - assert_raise ArgumentError do + assert_raises ArgumentError do Class.new do include ROXML xml_reader :object_key_to_text, :as => {:key => BookWithContributorHash, :value => 'text_node'} end end end def test_hash_with_object_value_fails - assert_raise ArgumentError do + assert_raises ArgumentError do Class.new do include ROXML xml_reader :key_to_object_value, :as => {:key => '@text_node', :value => BookWithContributorHash} @@ -101,15 +102,6 @@ <EmptyDictionary> </EmptyDictionary> </dict> }).missing_hash) end - - def test_as_hash_of_as_type_not_deprecated - assert_not_deprecated do - opts = ROXML::Definition.new(:name, :as => {:key => :name, :value => {:from => 'value', :as => OctalInteger}}) - assert opts.hash? - assert_equal OctalInteger, opts.hash.value.sought_type - assert_equal 'value', opts.hash.value.name - end - end -end \ No newline at end of file +end