[yast-devel] RSpec3 accepted in SLE12-SP1, it can be used in Git "master" branch
Hi all, I have a good news for you, RSpec has been updated to version 3 in SLE12-SP1! (Specifically to 3.3.x, I submitted the same version as is currently in Factory.) That means we can now use RSpec3 syntax and the new features in the `master` Git branch! Of course you have to be careful when backporting a SLE12 maintenance fix, there is still RSpec2 in SLE12-GA... See [1] for a nice overview of changes from RSpec2 to RSpec3. Probably the most important new RSpec3 feature is the "verifying doubles" ability. That feature checks that the mocked method is actually present on the specified object. This avoids mocking non-existing methods which can make the test pass but when the code is really executed it would fail with "NoMethod" error. See [2] and [3] for more details, see [4] how to enable it as the feature is disabled by default for backward compatibility. Enjoy! [1] http://rspec.info/blog/2014/05/notable-changes-in-rspec-3 [2] http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#verifying-doubles [3] https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles [4] https://relishapp.com/rspec/rspec-mocks/v/3-3/docs/verifying-doubles/partial... -- Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Thu, 30 Jul 2015 11:07:25 +0200
Ladislav Slezak
Hi all,
I have a good news for you, RSpec has been updated to version 3 in SLE12-SP1! (Specifically to 3.3.x, I submitted the same version as is currently in Factory.)
That means we can now use RSpec3 syntax and the new features in the `master` Git branch! Of course you have to be careful when backporting a SLE12 maintenance fix, there is still RSpec2 in SLE12-GA...
See [1] for a nice overview of changes from RSpec2 to RSpec3.
Probably the most important new RSpec3 feature is the "verifying doubles" ability. That feature checks that the mocked method is actually present on the specified object. This avoids mocking non-existing methods which can make the test pass but when the code is really executed it would fail with "NoMethod" error.
See [2] and [3] for more details, see [4] how to enable it as the feature is disabled by default for backward compatibility.
I think we should really consider to enable this feature by default in yast/rspec as it is very useful feature. Josef
Enjoy!
[1] http://rspec.info/blog/2014/05/notable-changes-in-rspec-3 [2] http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#verifying-doubles [3] https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles [4] https://relishapp.com/rspec/rspec-mocks/v/3-3/docs/verifying-doubles/partial...
--
Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Dne 30.7.2015 v 11:07 Ladislav Slezak napsal(a):
Hi all,
I have a good news for you, RSpec has been updated to version 3 in SLE12-SP1! (Specifically to 3.3.x, I submitted the same version as is currently in Factory.)
That means we can now use RSpec3 syntax and the new features in the `master` Git branch! Of course you have to be careful when backporting a SLE12 maintenance fix, there is still RSpec2 in SLE12-GA...
FYI: I have globally switched to Rspec 3 in all .travis.yml files. I did it globally in `master` without pull requests by a script, the affected repositories are: yast-auth-client yast-autoinstallation yast-bootloader yast-cio yast-country yast-dhcp-server yast-dns-server yast-fcoe-client yast-firewall yast-fonts yast-inetd yast-installation yast-instserver yast-iscsi-client yast-iscsi-lio-server yast-journal yast-kdump yast-lxc yast-migration yast-network yast-nfs-client yast-online-update yast-online-update-configuration yast-packager yast-pam yast-proxy yast-reipl yast-ruby-bindings yast-security yast-services-manager yast-slp yast-squid yast-storage yast-sysconfig yast-s390 yast-update yast-yast2 -- Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (2)
-
Josef Reidinger
-
Ladislav Slezak