assert new File('foo.bar') == new File('example.txt')
will yield this output:
Caught: Assertion failed: assert new File('foo.bar') == new File('example.txt') | | | foo.bar | example.txt false
Isn’t that cool?
Read more about the new Features in Groovy 1.7.
Diese Artikel könnten Sie noch interessieren:
- Groovy is groovy For AndroMDA 4, I designed a plugin registry configuration language...
- “Soft assertions” in Groovy Ted Naleid hat einen guten Artikel über Unit-Testing mit Soft...
- Do you want to know who is near you? Imagine you see “the most beautiful girl in the world”...
Berater, Coach und Trainer für effektive Produktentwicklung
Wow! Bin beeindruckt! Sehr schöne Darstellung in der Konsole.
Bislang war der “Inhalt” dessen, was verglichen wurde, ja meist nicht zu sehen und daher schrieb ich quasi immer mein eigenes assertEquals, wie man es in JUnit kennt. Ist zwar auch nur ein Einzeiler, aber diese Ära dürfte damit zu Ende gehen – bin überhaupt nicht traurig drum