-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge into Sle 12 sp1 #23
Conversation
#!/usr/bin/env rspec | ||
|
||
require_relative "../test_helper" | ||
require_relative "../../src/clients/firewall_auto.rb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is problematic as requiring client cause its execution. So we usually avoid it. E.g. all mocking is not done during such run. For auto client I expect that without arguments it do nothing, but you should not rely on it. As e.g. with using https://github.com/yast/yast-yast2/blob/master/library/general/src/lib/installation/auto_client.rb#L60 new base class for auto clients it will raise exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw nasty workaround for it is using load File.expand_path("../../src/clients/firewall_auto.rb", __FILE__)
instead of calling main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jreidinger we will apply the nasty workaround for SP1, as we can change it for SP2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then I really suggest to not use require_relative and instead use WFM.CallFunction https://github.com/yast/yast-ruby-bindings/blob/master/src/ruby/yast/wfm.rb#L164 with given parameters as it is much closer to expected usage. So instead of stubbing args you call expect(Yast::WFM.CallFunction("firewall_auto", ["Summary"])).to eq "Some summary"
I don't know how that is supposed to help. |
So I would drop commit d96edf3 and instead add a comment at the
|
Tricky part is that is it always executed, so you can do mock this and that and then |
OK, that could work, but in this case that is not done and I think it is not worth it. |
@teclator what is status here? |
@jreidinger it has not been lgmted yet, in that momment it should merged, @Imobach what do you think about? |
ok, so LGTM from me. it is always good to have tests :) |
No description provided.