Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:yast/yast-yast2 into sshd_enablement
- Loading branch information
Showing
73 changed files
with
1,879 additions
and
1,377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
TESTS = \ | ||
asciifile_test.rb \ | ||
linuxrc_test.rb \ | ||
hooks_test.rb | ||
hooks_test.rb \ | ||
os_release_test.rb \ | ||
popup_test.rb | ||
|
||
TEST_EXTENSIONS = .rb | ||
RB_LOG_COMPILER = rspec | ||
VERBOSE = 1 | ||
EXTRA_DIST = $(TESTS) | ||
EXTRA_DIST = $(TESTS) test_helper.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#! /usr/bin/env rspec | ||
|
||
require File.expand_path("../test_helper.rb", __FILE__) | ||
|
||
require "yast" | ||
|
||
Yast.import "OSRelease" | ||
Yast.import "FileUtils" | ||
Yast.import "Misc" | ||
|
||
describe Yast::OSRelease do | ||
describe "#ReleaseInformation" do | ||
it "returns product name if release file exists" do | ||
Yast::FileUtils.stub(:Exists).and_return(true) | ||
Yast::Misc.stub(:CustomSysconfigRead).and_return("openSUSE 13.1 (Bottle) (x86_64)") | ||
expect(Yast::OSRelease.ReleaseInformation("/mnt")).to eq "openSUSE 13.1" | ||
end | ||
|
||
it "throws exception Yast::OSReleaseFileMissingError if release file does not exist" do | ||
Yast::FileUtils.stub(:Exists).and_return(false) | ||
expect { Yast::OSRelease.ReleaseInformation("/mnt") }.to raise_error( | ||
Yast::OSReleaseFileMissingError | ||
) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /usr/bin/env rspec | ||
|
||
require File.expand_path("../test_helper.rb", __FILE__) | ||
|
||
require "yast" | ||
include Yast | ||
|
||
Yast.import "Popup" | ||
|
||
describe "Popup" do | ||
let(:ui) { double("Yast::UI") } | ||
|
||
before do | ||
# generic UI stubs for the progress dialog | ||
stub_const("Yast::UI", ui) | ||
end | ||
|
||
describe ".Feedback" do | ||
before do | ||
expect(ui).to receive(:OpenDialog) | ||
expect(ui).to receive(:CloseDialog) | ||
allow(ui).to receive(:BusyCursor) | ||
allow(ui).to receive(:GetDisplayInfo).and_return({}) | ||
end | ||
|
||
it "opens a popup dialog and closes it at the end" do | ||
# just pass an empty block | ||
Popup.Feedback("Label", "Message") {} | ||
end | ||
|
||
it "closes the popup even when an exception occurs in the block" do | ||
# raise an exception in the block | ||
expect{Popup.Feedback("Label", "Message") { raise "TEST"}}.to raise_error(RuntimeError, "TEST") | ||
end | ||
|
||
it "raises exception when the block parameter is missing" do | ||
# no block passed | ||
expect{Popup.Feedback("Label", "Message")}.to raise_error(LocalJumpError) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
top_srcdir = File.expand_path("../../../..", __FILE__) | ||
inc_dirs = Dir.glob("#{top_srcdir}/library/*/src") | ||
ENV["Y2DIR"] = inc_dirs.join(":") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.