kszbcss / xspec

Private backup of the xspec project at google code, as google code is going to disappear.
MIT License
1 stars 0 forks source link

Mock function or template of tested xsl #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Task:
xspec is used to test template A which calls function F and behaves accordingly 
to F results.
In order to simplify testing of A - ability to mock function F for current test 
suite (x:description) is crucial.

Solutions:
1. Stylesheet M with mocked function imports A. And is used as entry point for 
description. 
2. x:function element or alternative (xsl:*) is supported on top level. 
x:variable and x:param are similary supported at the moment.

Solution 1 could work even now but it produces lot of additional files that 
makes tests unreadable

Solution 2 allow quick in-place mocking. 

Drawbacks:
x:import becomes unusable in case when 2 different descriptions have different 
mocks of function or template. However any x:variables or x:param becomes 
unusable if import is used.

Is it possible to add this feature into xspec? I could provide patch with 
changes to support it.

Thanks

Original issue reported on code.google.com by volodymy...@gmail.com on 3 May 2012 at 4:31