Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stringbean/scala-xml-compare
XML Comparison Utils for Scala
https://github.com/stringbean/scala-xml-compare
diff scala scalatest specs2 xml
Last synced: 27 days ago
JSON representation
XML Comparison Utils for Scala
- Host: GitHub
- URL: https://github.com/stringbean/scala-xml-compare
- Owner: stringbean
- Created: 2017-08-23T10:45:53.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-17T11:08:44.000Z (over 4 years ago)
- Last Synced: 2024-04-16T10:58:58.040Z (7 months ago)
- Topics: diff, scala, scalatest, specs2, xml
- Language: Scala
- Homepage: https://stringbean.github.io/scala-xml-compare
- Size: 1.34 MB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Build Status](https://img.shields.io/travis/com/stringbean/scala-xml-compare/master.svg)](https://travis-ci.com/stringbean/scala-xml-compare)
[![Codacy Grade](https://img.shields.io/codacy/grade/47939504d2cc49b0a7eb21f6bcc5c24d.svg?label=codacy)](https://www.codacy.com/app/stringbean/scala-xml-compare)
[![Test Coverage](https://img.shields.io/codecov/c/github/stringbean/scala-xml-compare/master.svg)](https://codecov.io/gh/stringbean/scala-xml-compare)
[![Maven Central - Scala 2.11](https://img.shields.io/maven-central/v/software.purpledragon.xml/xml-compare_2.11.svg?label=scala%202.11)](https://search.maven.org/search?q=g:software.purpledragon.xml%20a:xml-compare_2.11)
[![Maven Central - Scala 2.12](https://img.shields.io/maven-central/v/software.purpledragon.xml/xml-compare_2.12.svg?label=scala%202.12)](https://search.maven.org/search?q=g:software.purpledragon.xml%20a:xml-compare_2.12)
[![Maven Central - Scala 2.13](https://img.shields.io/maven-central/v/software.purpledragon.xml/xml-compare_2.13.svg?label=scala%202.13)](https://search.maven.org/search?q=g:software.purpledragon.xml%20a:xml-compare_2.13)
![MiMa Checked Against](https://img.shields.io/badge/MiMa%20Compatiblitity-2.0.0-brightGreen)# XML Comparison Utils for Scala
`scala-xml-compare` is a small Scala library for comparing XML documents.
## Quickstart
Add the following to your `build.sbt`:
```scala
libraryDependencies += "software.purpledragon.xml" %% "xml-compare" % ""
```You can then compare XML using:
```scala
val doc1 = John Smith
val doc2 = Peter Smithval result = XmlCompare.compare(doc1, doc2)
// result1 = XmlDiffers("different text", "John Smith", "Peter Smith")
```### Scalatest
A companion library is provided for testing XML in Scalatest:
```scala
libraryDependencies += "software.purpledragon.xml" %% "xml-scalatest" % "" % Test
```This then enables the `beXml` matcher:
```scala
val doc = John Smith
doc should beXml(John Smith)
```### specs2
Similarly a companion library for specs2 is provided:
```scala
libraryDependencies += "software.purpledragon.xml" %% "xml-specs2" % "" % Test
```