{"id":32955575,"url":"https://github.com/alovak/test_xml","last_synced_at":"2025-11-13T08:00:42.190Z","repository":{"id":770506,"uuid":"455397","full_name":"alovak/test_xml","owner":"alovak","description":"Small library to test your xml with Test::Unit or RSpec","archived":false,"fork":false,"pushed_at":"2016-11-25T21:43:49.000Z","size":76,"stargazers_count":30,"open_issues_count":6,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-11-03T22:15:04.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alovak.png","metadata":{"files":{"readme":"README.rdoc","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-01-01T20:06:04.000Z","updated_at":"2021-04-09T08:00:08.000Z","dependencies_parsed_at":"2022-08-16T10:50:25.429Z","dependency_job_id":null,"html_url":"https://github.com/alovak/test_xml","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alovak/test_xml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alovak%2Ftest_xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alovak%2Ftest_xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alovak%2Ftest_xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alovak%2Ftest_xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alovak","download_url":"https://codeload.github.com/alovak/test_xml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alovak%2Ftest_xml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283797302,"owners_count":26896277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-11T02:00:06.610Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-12T22:00:46.433Z","updated_at":"2025-11-13T08:00:42.184Z","avatar_url":"https://github.com/alovak.png","language":"Ruby","readme":"= TestXml\n\n== DESCRIPTION\n\nTestXml is a small extension for testing XML/HTML. Extending RSpec and TestUnit it makes asserting and comparing XML snippets easy, and is especially helpful for testing RESTful web services and their XML representations.\n\n\n== FEATURES\n\n* Runs with RSpec 2 or 3, Test::Unit, MiniTest and Cucumber\n* Ruby \u003e= 1.8\n* Test XML structure and content\n\n\n== INSTALL\n\n  gem install test_xml\n\n\n== EXAMPLES\n\n=== Test::Unit and MiniTest\n\n  def test_item_representation\n    assert_xml_equal \"\u003citem\u003e\u003cid\u003e1\u003c/id\u003e\u003c/item\u003e\", @item.to_xml\n  end\n\n=== RSpec\n\n  it \"should contain the id\" do\n    @item.to_xml.should equal_xml(\u003c\u003c-XML)\n      \u003citem\u003e\n        \u003cid\u003e1\u003c/id\u003e\n      \u003c/item\u003e\n    XML\n  end\n\n=== Cucumber\n\n  Scenario:\n    When I post some data\n    Then the response should match the following xml\n    \"\"\"\n      \u003ctransaction\u003e\n        \u003cstatus\u003esuccess\u003c/status\u003e\n        \u003cid/\u003e\n        \u003corder_id/\u003e\n      \u003c/transaction\u003e\n    \"\"\"\n\n== USAGE:\n\n=== RSpec\n\nIn your spec_helper.rb\n\n  require 'test_xml/spec'\n\nAnd in the actual spec, use these matchers:\n\n* equal_xml\n* contain_xml\n* equal_xml_structure\n* contain_xml_structure\n\n=== Test::Unit\n\nIn the test_helper.rb\n\n  require 'test_xml/test_unit'\n\nIn your test file, use these matchers:\n\n* assert_xml_equal\n* assert_xml_contain\n* assert_xml_structure_equal\n* assert_xml_structure_contain\n\nNegative assertions are available as \u003ctt\u003eassert_not_*\u003c/tt\u003e.\n\n=== MiniTest\n\nIn the test_helper.rb\n\n  require 'test_xml/mini_test'\n\nCheck the Test::Unit section for available assertions.\n\n=== Cucumber\n\nIn the features/env.rb\n\n  require 'test_xml'\n  require 'test_xml/spec'\n  World(TestXml::Spec)\n\nIn your steps file e.g. features/step_definitions/xml_steps.rb add this step:\n  \n  Then /^the response should match the following xml$/ do |xml|\n    response.body.should equal_xml(xml)\n  end\n\n== ASSERTIONS\n\n=== XML is Equal\n\nElements, attributes and text nodes are all the same\n\n=== XML Contains\n\nThe XML contains the given structure. Checks ancestral relationships, elements, attributes and text nodes \u003cb\u003estarting from and including the root node\u003c/b\u003e.\n\nFor example, given this XML:\n\n  \u003ca\u003e\n    \u003cb\u003e\u003cc\u003eCee\u003c/c\u003e\u003c/b\u003e\n    \u003cd\u003eDee\u003c/b\u003e\n  \u003c/a\u003e\n\nThis will fail: \n\n  \u003cb\u003e\u003cc\u003eCee\u003c/c\u003e\u003c/b\u003e\n\nas +b+ is not the root node. The check must be written as: \n\n  \u003ca\u003e\n    \u003cb\u003e\u003cc\u003eCee\u003c/c\u003e\u003c/b\u003e\n  \u003c/a\u003e\n\n=== XML Structure is Equal\n\nLike XML is equal, but ignores attributes and text nodes\n\n=== XML Structure Contains\n\nLike XML contains, but ignores attributes and text nodes\n\n== REQUIREMENTS\n\n* nokogiri\n\n== Many Thanks\n\n{Nick Sutterer}[http://github.com/apotonick] thank you for bringing RSpec 2, Ruby 1.9.2 and MiniTest! You revived the gem! :)\n\n== LICENSE\n\nCopyright © 2010-2011, Pavel Gabriel\n\nReleased under the MIT License. \n","funding_links":[],"categories":["Testing"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falovak%2Ftest_xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falovak%2Ftest_xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falovak%2Ftest_xml/lists"}