Skip to content

Commit

Permalink
Updated testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Jul 22, 2015
1 parent 53539c1 commit 80b451b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/Makefile.am
Expand Up @@ -24,6 +24,7 @@ TESTS = \
s390_helpers_test.rb \
suse_firewall_4_network_test.rb \
udev_test.rb \
alias_dialog_test.rb \
widgets_test.rb

TEST_EXTENSIONS = .rb
Expand Down
41 changes: 41 additions & 0 deletions test/alias_dialog_test.rb
@@ -0,0 +1,41 @@
#!/usr/bin/env rspec

require_relative "test_helper"

require "yast"

class AliasDialog
include Yast::I18n
include Yast::UIShortcuts

def initialize
Yast.include self, "network/lan/virtual.rb"
end
end

describe "VirtualEditDialog" do
# bnc#864264
it "passes smoke test" do
include Yast::UIShortcuts

Yast.import "UI"
Yast.import "LanItems"

allow(Yast::UI).to receive(:UserInput).and_return(:ok)
allow(Yast::UI)
.to receive(:QueryWidget)
.and_return("")
allow(Yast::UI)
.to receive(:QueryWidget)
.with(Id(:ipaddr), :Value)
.and_return("1.1.1.1")
allow(Yast::UI)
.to receive(:QueryWidget)
.with(Id(:netmask), :Value)
.and_return("255.0.0.0")
allow(Yast::LanItems).to receive(:device).and_return("")

expect(Yast::UI).to receive(:UserInput).once
expect(AliasDialog.new.VirtualEditDialog(0, term(:empty), nil)).not_to be nil
end
end

0 comments on commit 80b451b

Please sign in to comment.