Mailinglist Archive: yast-devel (144 mails)

< Previous Next >
Re: [yast-devel] Requirements for Yast testing framework
# lslezak@xxxxxxx / 2013-08-15 11:24:53 +0200:
I did some more research regarding to minitest and found this:

The official documentation:
http://www.ruby-doc.org/stdlib-2.0/libdoc/minitest/rdoc/index.html

A nice overview with both rspec-like and testunit-like examples,
including mocking:
http://www.mattsears.com/articles/2011/12/10/minitest-quick-reference


Mocking examples:
http://stackoverflow.com/questions/10465350/ruby-mocking-a-class-method-with-minitest
http://tatey.com/2012/02/07/mocking-with-minitest-mock-and-simple-delegator/
http://stackoverflow.com/questions/7211086/how-do-i-stub-things-in-minitest

The mocking API does not look as powerfull as in 'mocha' gem[1], but should be
enough I guess. If it would not be sufficient then using mocha is possible, it
supports both minitest and testunit.

i just looked at the minitest code[1], and it can apparently verify calls
including argument values. you can't say "expect a call to #foo with any
arguments" or "expect any number of calls to #bar", but i'd say that's a
good thing, at least in the long run.

[1] https://github.com/seattlerb/minitest/blob/master/lib/minitest/mock.rb

--
roman
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >