Skip to content
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

bsc#1036440: Warning messages shouldn't open UI in command-line mode #580

Merged
merged 8 commits into from May 30, 2017

Conversation

gilsonsouza
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.004%) to 58.734% when pulling b72de08 on gilsonsouza:SLE-12-SP1 into 575c145 on yast:SLE-12-SP1.

Copy link
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good, but I am missing some test cases. Please, check report_test.rb and try to add some test cases.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.019% when pulling 214b168 on gilsonsouza:SLE-12-SP1 into 575c145 on yast:SLE-12-SP1.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.019% when pulling cf4831c on gilsonsouza:SLE-12-SP1 into 575c145 on yast:SLE-12-SP1.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.019% when pulling c6dafdc on gilsonsouza:SLE-12-SP1 into 575c145 on yast:SLE-12-SP1.

it "prints the message only on console" do
expect(Yast::CommandLine).to receive("Print")
.with(/#{message}/)
expect(Yast::Popup).to_not receive("Warning")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for consistence, I would use :Warning symbol instead of the string.


before(:each) do
subject.DisplayWarnings(show, timeout)
allow(Yast::Mode).to receive(:commandline).and_return(false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are going to mock Yast::Mode.commandline in all cases, maybe you would like to move it to a before block and just define the value for each case.

before do
  allow(Yast::Mode).to receive(:commandline).and_return(commandline?)
end

context "while in UI mode and timeout is disabled" do
  let(:timeout) { 0 }
  let(:commandline?) { false }

  it "shows a popup" do
    #...
  end
end


context "while in command-line mode" do
before(:each) do
allow(Yast::Mode).to receive(:commandline).and_return(true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same than above. I would move this line to the outer before block.

@@ -1,4 +1,11 @@
-------------------------------------------------------------------
Mon May 29 08:19:46 UTC 2017 - gsouza@suse.com

- bsc#1036440: Warning messages shouldn't open UI in command-line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually write it like this:

- Warning messages shouldn't open UI in command-line mode (bsc#1036440)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.024% when pulling d06a6f6 on gilsonsouza:SLE-12-SP1 into 575c145 on yast:SLE-12-SP1.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.024% when pulling 369bc5e on gilsonsouza:SLE-12-SP1 into 575c145 on yast:SLE-12-SP1.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 59.024% when pulling ef4a4f3 on gilsonsouza:SLE-12-SP1 into 575c145 on yast:SLE-12-SP1.

@imobachgs
Copy link
Contributor

Thanks for these tests!

@gilsonsouza gilsonsouza merged commit e70a48a into yast:SLE-12-SP1 May 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants