使用 TDD/BDD 开发 XSLT

发布于 2024-09-09 16:44:16 字数 136 浏览 3 评论 0原文

我被分配的任务是对数据库中的 XML 转储创建 XSLT 转换。作为测试/行为驱动开发的信徒,我想知道是否有人以前尝试过,或者有关于如何进行的建议。

我的直觉反应是用 rspec 测试这个“黑匣子”。是否有用于测试 XSLT 的单元测试框架?

I've been assigned the task of creating an XSLT transform on an XML dump from a database. Being a believer of Test/Behavior Driven Development I was wondering if anyone has attempted it before or has advice about how to go about it.

My gut reaction is to test this 'black box' with rspec. Is there a unit testing framework out there for testing XSLT?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

依 靠 2024-09-16 16:44:16

有一个用于测试 XSLT 的 BDD 框架,名为 xspec,它基于 Jeni Tennison 开发的 rspec 。

There is a BDD framework for testing XSLT called xspec which is based on rspec developed by Jeni Tennison.

ぺ禁宫浮华殁 2024-09-16 16:44:16

我最近发现自己在问类似的问题,但是是用 Java 而不是 Ruby。我正在编写一个 XSLT 样式表,并希望对其进行一些自动化测试。最后,我采用的方法是使用 XSLT 样式表来转换一些示例 XML 文档,然后对每个结果运行 XPath 查询。我想这与你的“本能反应”非常相似。

快速 Google 一下就会发现许多 XSLT 单元测试框架,但其中大多数似乎都是针对 Java,而不是 Ruby。我选择不在我的项目中使用它们中的任何一个,因为几乎所有它们似乎都不再得到积极维护。

I recently found myself asking a similar question, but with Java rather than Ruby. I was writing an XSLT stylesheet and wanted to have some automated tests for it. In the end, the approach I adopted was to use the XSLT stylesheet to transform some sample XML documents and then run XPath queries on each of the results. I guess this is much the same approach as your 'gut reaction'.

A quick Google turns up a number of XSLT unit-testing frameworks, but most of these appear to target Java, not Ruby. I chose not to use any of them with my project since almost all of them seem to no longer be actively maintained.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文