Stefan Schubert write:
> ref: refs/heads/master
> commit dd33d008822d216d94a061fcfc2017385c7fb0f9
> Author: Stefan Schubert <[email protected]>
> Date: Thu Oct 8 13:50:13 2009 +0200
>
> test on empty list
> ---
> .../app/controllers/patch_updates_controller.rb | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git
> a/plugins/patch_updates/app/controllers/patch_updates_controller.rb
> b/plugins/patch_updates/app/controllers/patch_updates_controller.rb index
> 507b97f..8f25528 100644
> --- a/plugins/patch_updates/app/controllers/patch_updates_controller.rb
> +++ b/plugins/patch_updates/app/controllers/patch_updates_controller.rb
> @@ -86,7 +86,7 @@ class PatchUpdatesController < ApplicationController
>
> flash.clear #no flash from load_proxy
> last_patch = ""
> - if patch_updates
> + if patch_updates.size > 0
Hi,
this is not correct change, because in case of error during loading
patch_updates you can have it as nil and then this part of code throws Unknown
method exception see:
begin
patch_updates = load_proxy 'org.opensuse.yast.system.patches', :all
rescue Exception => e
error = e
patch_updates = nil # here you set nil
end
flash.clear #no flash from load_proxy
last_patch = ""
#here can be patch_update nil and nil Class doesn't have size method
if patch_updates.size > 0
I suggest add to test case test what happen when load_proxy throw error and
test if it end in expected result.
--
Josef Reidinger
YaST team
maintainer of perl-Bootloader, YaST2-Repair, webyast modules language and
time
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]