test/unit/definition_test.rb in roxml-3.1.5 vs test/unit/definition_test.rb in roxml-3.1.6

- old
+ new

@@ -1,6 +1,6 @@ -require 'test/test_helper' +require_relative './../test_helper' class TestDefinition < ActiveSupport::TestCase def assert_hash(opts, kvp) assert opts.hash? assert !opts.array? @@ -22,11 +22,11 @@ def test_block_shorthand_in_array_means_array opts = ROXML::Definition.new(:intarray, :as => [Integer]) assert opts.array? assert_equal :text, opts.sought_type - assert 1, opts.blocks.size + assert_equal 1, opts.blocks.size end def test_required assert !ROXML::Definition.new(:author).required? assert ROXML::Definition.new(:author, :required => true).required? @@ -171,20 +171,20 @@ assert_equal RoxmlObject, ROXML::Definition.new(:types, :as => [RoxmlObject]).sought_type end def test_default_works opts = ROXML::Definition.new(:missing, :else => true) - assert_equal true, opts.to_ref(RoxmlObject.new).value_in(ROXML::XML::Parser.parse('<xml></xml>')) + assert_equal true, opts.to_ref(RoxmlObject.new).value_in(ROXML::XML.parse_string('<xml></xml>')) end def test_default_works_for_arrays opts = ROXML::Definition.new(:missing, :as => []) - assert_equal [], opts.to_ref(RoxmlObject.new).value_in(ROXML::XML::Parser.parse('<xml></xml>')) + assert_equal [], opts.to_ref(RoxmlObject.new).value_in(ROXML::XML.parse_string('<xml></xml>')) end def test_default_works_for_recursive_objects opts = ROXML::Definition.new(:missing, :as => RecursiveObject, :else => false) - assert_equal false, opts.to_ref(RoxmlObject.new).value_in(ROXML::XML::Parser.parse('<xml></xml>')) + assert_equal false, opts.to_ref(RoxmlObject.new).value_in(ROXML::XML.parse_string('<xml></xml>')) end def test_content_is_accepted_as_from assert ROXML::Definition.new(:author, :from => :content).content? assert ROXML::Definition.new(:author, :from => '.').content? \ No newline at end of file