Skip to content

Commit

Permalink
Merge pull request #442 from imobach/add-commit-result-reporting-v2
Browse files Browse the repository at this point in the history
Add commit result reporting
  • Loading branch information
imobachgs committed Feb 23, 2016
2 parents 5a86708 + 91f3494 commit e986831
Show file tree
Hide file tree
Showing 18 changed files with 714 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,7 @@ before_install:
# disable rvm, use system Ruby
- rvm reset
- wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh
- sh ./travis_setup.sh -p "rake yast2-core yast2-devtools yast2-testsuite yast2-ruby-bindings yast2-pkg-bindings ruby2.1-dev libaugeas-dev pkg-config" -g "rspec:3.3.0 yast-rake gettext simplecov coveralls rubocop:0.29.1 cheetah abstract_method cfa"
- sh ./travis_setup.sh -p "rake yast2-core yast2-devtools yast2-testsuite yast2-ruby-bindings yast2-pkg-bindings ruby2.1-dev libaugeas-dev pkg-config" -g "rspec:3.3.0 yast-rake gettext simplecov coveralls:0.8.10 rubocop:0.29.1 cheetah abstract_method cfa"
script:
- rake check:pot
- rubocop
Expand Down
9 changes: 1 addition & 8 deletions library/general/src/modules/Popup.rb
Expand Up @@ -80,14 +80,7 @@ def popupLayoutInternalTypeWithLabel(headline, message, button_box, label, richt
HSpacing(width),
HBox(
VSpacing(height),
# display the message in the widget "as is":
# escape all tags, replace new lines by <br> tag
RichText(
Builtins.mergestring(
Builtins.splitstring(String.EscapeTags(message), "\n"),
"<br>"
)
)
RichText(message)
)
)
)
Expand Down
1 change: 1 addition & 0 deletions library/general/test/Makefile.am
Expand Up @@ -11,6 +11,7 @@ TESTS = \
popup_test.rb \
proposal_client_test.rb \
service_status_test.rb \
report_test.rb \
agents_test/proc_meminfo_agent_test.rb

TEST_EXTENSIONS = .rb
Expand Down
259 changes: 259 additions & 0 deletions library/general/test/popup_test.rb
Expand Up @@ -36,4 +36,263 @@
expect { subject.Feedback("Label", "Message") }.to raise_error
end
end

describe ".Message" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.Message("<h1>Title</h1>")
end
end

describe ".Warning" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.Warning("<h1>Title</h1>")
end
end

describe ".Error" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.Error("<h1>Title</h1>")
end
end

#
# LongMessage
#
describe ".LongMessage" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.LongMessage("<h1>Title</h1>")
end
end

describe ".LongMessageGeometry" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.LongMessage("<h1>Title</h1>")
end

it "sets dialog width and height" do
allow(subject).to receive(:HSpacing)
allow(subject).to receive(:VSpacing)
expect(subject).to receive(:HSpacing).with(30)
expect(subject).to receive(:VSpacing).with(40)
subject.LongMessageGeometry("Title", 30, 40)
end
end

describe ".TimedLongMessage" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.TimedLongMessage("<h1>Title</h1>", 1)
end
end

describe ".TimedLongMessageGeometry" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.TimedLongMessageGeometry("<h1>Title</h1>", 1, 30, 40)
end

it "sets dialog width and height" do
allow(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:HSpacing)
allow(subject).to receive(:VSpacing)
expect(subject).to receive(:HSpacing).with(30)
expect(subject).to receive(:VSpacing).with(40)
subject.TimedLongMessageGeometry("Title", 1, 30, 40)
end
end

#
# LongWarning
#
describe ".LongWarning" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.LongWarning("<h1>Title</h1>")
end
end

describe ".LongWarningGeometry" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.LongWarningGeometry("<h1>Title</h1>", 30, 40)
end

it "sets dialog width and height" do
allow(subject).to receive(:HSpacing)
allow(subject).to receive(:VSpacing)
expect(subject).to receive(:HSpacing).with(30)
expect(subject).to receive(:VSpacing).with(40)
subject.LongWarningGeometry("Title", 30, 40)
end
end

describe ".TimedLongWarning" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.TimedLongWarning("<h1>Title</h1>", 1)
end
end

describe ".TimedLongWarningGeometry" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.TimedLongWarningGeometry("<h1>Title</h1>", 1, 30, 40)
end

it "sets dialog width and height" do
allow(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:HSpacing)
allow(subject).to receive(:VSpacing)
expect(subject).to receive(:HSpacing).with(30)
expect(subject).to receive(:VSpacing).with(40)
subject.TimedLongWarningGeometry("Title", 1, 30, 40)
end
end

#
# LongError
#
describe ".LongError" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.LongError("<h1>Title</h1>")
end
end

describe ".LongErrorGeometry" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.LongErrorGeometry("<h1>Title</h1>", 30, 40)
end

it "sets dialog width and height" do
allow(subject).to receive(:HSpacing)
allow(subject).to receive(:VSpacing)
expect(subject).to receive(:HSpacing).with(30)
expect(subject).to receive(:VSpacing).with(40)
subject.LongErrorGeometry("Title", 30, 40)
end
end

describe ".TimedLongError" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.TimedLongError("<h1>Title</h1>", 1)
end
end

describe ".TimedLongErrorGeometry" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.TimedLongErrorGeometry("<h1>Title</h1>", 1, 30, 40)
end

it "sets dialog width and height" do
allow(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:HSpacing)
allow(subject).to receive(:VSpacing)
expect(subject).to receive(:HSpacing).with(30)
expect(subject).to receive(:VSpacing).with(40)
subject.TimedLongErrorGeometry("Title", 1, 30, 40)
end
end

#
# TimedLongNotify
#
describe ".LongNotify" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.LongNotify("<h1>Title</h1>")
end
end

describe ".LongNotifyGeometry" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.LongNotifyGeometry("<h1>Title</h1>", 30, 40)
end

it "sets dialog width and height" do
allow(subject).to receive(:HSpacing)
allow(subject).to receive(:VSpacing)
expect(subject).to receive(:HSpacing).with(30)
expect(subject).to receive(:VSpacing).with(40)
subject.LongNotifyGeometry("Title", 30, 40)
end
end

describe ".TimedLongNotify" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.TimedLongNotify("<h1>Title</h1>", 1)
end
end

describe ".TimedLongNotifyGeometry" do
before { allow(ui).to receive(:OpenDialog) }

it "shows a popup without escaping tags" do
expect(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:RichText).with("<h1>Title</h1>")
subject.TimedLongNotifyGeometry("<h1>Title</h1>", 1, 30, 40)
end

it "sets dialog width and height" do
allow(ui).to receive(:TimeoutUserInput)
allow(subject).to receive(:HSpacing)
allow(subject).to receive(:VSpacing)
expect(subject).to receive(:HSpacing).with(30)
expect(subject).to receive(:VSpacing).with(40)
subject.TimedLongNotifyGeometry("Title", 1, 30, 40)
end
end
end

0 comments on commit e986831

Please sign in to comment.