Sha256: 205680f19e8e69f588a1bc332834147254215d70fe124fb55fa3fa49c1ea94c5
Contents?: true
Size: 1.37 KB
Versions: 2
Compression:
Stored size: 1.37 KB
Contents
require File.join(File.dirname(__FILE__), "..", "helper") class TestShortcutMethod < Test::Unit::TestCase context "Calling []" do setup do ApricotEatsGorilla.setup do |s| s.sort_keys = true s.disable_tag_names_to_lower_camel_case = false s.disable_hash_keys_to_snake_case = false s.disable_hash_keys_to_symbols = false s.nodes_to_namespace = nil end end context "with an XML String" do should "return a Hash containing the XML content" do xml = "<root><name>Jungle Julia</name></root>" expected = { :name => "Jungle Julia" } result = ApricotEatsGorilla[xml] assert_equal expected, result end end context "with an XML String and a custom root node" do should "return a Hash containing the XML content starting at custom root" do xml = "<root><something><name>Jungle Julia</name></something></root>" expected = { :name => "Jungle Julia" } result = ApricotEatsGorilla[xml, "//something"] assert_equal expected, result end end context "with a Hash" do should "return an XML String containing the XML content" do hash = { "apricot" => "eats gorilla" } expected = "<apricot>eats gorilla</apricot>" result = ApricotEatsGorilla[hash] assert_equal expected, result end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
smacks-apricoteatsgorilla-0.4.6 | test/apricoteatsgorilla/test_shortcut_method.rb |
smacks-apricoteatsgorilla-0.4.7 | test/apricoteatsgorilla/test_shortcut.rb |