Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

test-unit-runner-junitxml

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-unit-runner-junitxml

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

[日本語]

Test

Test::Unit::Runner::JUnitXml

Test::Unit::Runner::JUnitXml is a test-unit runner that reports test result in JUnit XML format.

Installation

$ gem install test-unit-runner-junitxml

Usage

By loading test/unit/runner/junitxml.rb, you can select junitxml runner via the --runner command line option of test script. This runner reports test result in JUnit XML format.

In addition, --junitxml-output-file command line option is added, and it becomes possible to output the test result to the file specified by this option.

# test.rb
require "test/unit/runner/junitxml"

class MyTest < Test::Unit::TestCase
  def test_1
    print("hello")
    assert_equal(1, 2)
  end
end
$ ruby test.rb --runner=junitxml --junitxml-output-file=result.xml
$ cat result.xml
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites>
	<testsuite name="MyTest" tests="1" errors="0" failures="1" skipped="0" time="0.0037614">
		<testcase classname="MyTest" name="test_1(MyTest)" file="test.rb" time="0.0036311" assertions="1">
			<failure message="&lt;1&gt; expected but was
&lt;2&gt;.">Failure:
test_1(MyTest) [test.rb:7]:
&lt;1&gt; expected but was
&lt;2&gt;.</failure>
			<system-out>hello</system-out>
		</testcase>
	</testsuite>
</testsuites>

Options

  • --junitxml-output-file=FILE_NAME
    • Output XML to the specified file instead of the standard output.
  • --junitxml-disable-output-capture
    • Disable capture of standard output and standard error.

License

MIT License

FAQs

Package last updated on 20 Jun 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc