Skip to content

Commit

Permalink
Added testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
kobliha committed Nov 29, 2013
1 parent 9cb2d05 commit 7f848be
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/Kdump.rb
Expand Up @@ -192,6 +192,9 @@ def main
# map <string, string > of kdump settings
#
@KDUMP_SETTINGS = {}

# initial kdump settings replaced in Read function
@initial_kdump_settings = deep_copy(@KDUMP_SETTINGS)
end

# Abort function
Expand Down
18 changes: 18 additions & 0 deletions test/fadump_test.rb
Expand Up @@ -51,3 +51,21 @@
expect(Yast::Kdump.use_fadump?).to be_false
end
end

describe "#use_fadump_changed?" do
it "returns false if use_fadump not changed" do
Yast::Kdump.ReadKdumpSettings

expect(Yast::Kdump.use_fadump_changed?).to be_false
end

it "returns true if use_fadump changed" do
Yast::Kdump.ReadKdumpSettings

Yast::Kdump.stub(:fadump_supported?).and_return(true)
original_value = Yast::Kdump.use_fadump?
Yast::Kdump.use_fadump(! original_value)

expect(Yast::Kdump.use_fadump_changed?).to be_true
end
end

0 comments on commit 7f848be

Please sign in to comment.