Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
= TestXml
== DESCRIPTION
TestXml 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.
== FEATURES
== INSTALL
gem install test_xml
== EXAMPLES
=== Test::Unit and MiniTest
def test_item_representation assert_xml_equal "1", @item.to_xml end
=== RSpec
it "should contain the id" do @item.to_xml.should equal_xml(<<-XML) 1 XML end
=== Cucumber
Scenario: When I post some data Then the response should match the following xml """ success <order_id/> """
== USAGE:
=== RSpec
In your spec_helper.rb
require 'test_xml/spec'
And in the actual spec, use these matchers:
=== Test::Unit
In the test_helper.rb
require 'test_xml/test_unit'
In your test file, use these matchers:
Negative assertions are available as assert_not_*.
=== MiniTest
In the test_helper.rb
require 'test_xml/mini_test'
Check the Test::Unit section for available assertions.
=== Cucumber
In the features/env.rb
require 'test_xml' require 'test_xml/spec' World(TestXml::Spec)
In your steps file e.g. features/step_definitions/xml_steps.rb add this step:
Then /^the response should match the following xml$/ do |xml| response.body.should equal_xml(xml) end
== ASSERTIONS
=== XML is Equal
Elements, attributes and text nodes are all the same
=== XML Contains
The XML contains the given structure. Checks ancestral relationships, elements, attributes and text nodes starting from and including the root node.
For example, given this XML:
Cee DeeThis will fail:
Cee
as +b+ is not the root node. The check must be written as:
Cee=== XML Structure is Equal
Like XML is equal, but ignores attributes and text nodes
=== XML Structure Contains
Like XML contains, but ignores attributes and text nodes
== REQUIREMENTS
== Many Thanks
{Nick Sutterer}[http://github.com/apotonick] thank you for bringing RSpec 2, Ruby 1.9.2 and MiniTest! You revived the gem! :)
== LICENSE
Copyright © 2010-2011, Pavel Gabriel
Released under the MIT License.
FAQs
Unknown package
We found that test_xml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.