[yast-devel] Easy SCR Mocking in Testsuites
Hi, As already announced last week, I've created a pure Ruby module as a replacement for YaST Runlevel called YaST Services Manager. For a pure Ruby module, I wanted to use a pure Ruby testing. See the example here https://github.com/kobliha/yast-services-manager/blob/master/test/unit/syste... Now we don't need to define a full SCR hash but we can simply mock the the returning values on-the-fly. Any function or method can be mocked and they can return different object/values in different states (1st call, 2nd call, 3rd call...). What we can mock with mocha can be found here: http://jamesmead.org/blog/2006-09-01-mocha-quickstart Of course, you can do even more. If you are interested, fork the yast-services-manager project and try to create your own testsuite (then make a pull request). For instance, you can test Starting and Enabling services. It's easy, it's fun! :) Thanks and Bye Lukas -- Lukas Ocilka, Cloud & Systems Management Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (1)
-
Lukas Ocilka