Dne 13. 06. 19 v 16:21 Josef Reidinger napsal(a):
> Hi, again I hit by thinking that verify_partial_doubles is now default in 
> rspec3.
> It is not and will be in rspec4.
[...]
> 
> So feel free to take it as inspiration and enable it also in your test helper.

Accidentally I found another problem, this time in the kdump module.

If you need to mock the AutoYaST mode in the tests you would do:

  allow(Yast::Mode).to receive(:autoinstallation).and_return(true)

This looks right, doesn't it? Um.... unfortunately it's wrong. The method is
surprisingly called "Yast::Mode.autoinst".

Accidentally the test passed anyway so this went undetected. After enabling 
verifying
doubles RSpec complained that the method does not exist.

In this case it was harmless, but it can be much worse. If you do the same typo 
in
the test and in the code then it might crash in runtime because of calling an
undefined method.


Currently I'm moving the YaST packages from Travis to GitHub Actions and I'm 
usually
touching the test_helper.rb files so I'm enabling this RSpec feature as well.



-- 
Ladislav Slezák
YaST Developer

SUSE LINUX, s.r.o.
Corso IIa
Křižíkova 148/34
18600 Praha 8
_______________________________________________
YaST Development mailing list -- [email protected]
To unsubscribe, email [email protected]
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives: 
https://lists.opensuse.org/archives/list/[email protected]

Reply via email to