Skip to content

Commit

Permalink
Extended test case
Browse files Browse the repository at this point in the history
- Onlt only Installation, but also Update
  • Loading branch information
kobliha committed Apr 29, 2014
1 parent 069cfcb commit a166484
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions library/packages/test/product_test.rb
Expand Up @@ -52,17 +52,30 @@ def stub_defaults
stub_defaults
end

context "while called in installation without os-release file" do
context "while called in installation system without os-release file" do
before(:each) do
Yast::Stage.stub(:stage).and_return("initial")
Yast::Mode.stub(:mode).and_return("installation")
Yast::OSRelease.stub(:os_release_exists?).and_return(false)
end

it "reads product information from zypp and fills up internal variables" do
expect(Yast::Product.name).to eq("openSUSE (SELECTED)")
expect(Yast::Product.short_name).to eq("openSUSE")
expect(Yast::Product.version).to eq("13.1")
describe "when the mode is Installation" do
it "reads product information from zypp and fills up internal variables" do
Yast::Mode.stub(:mode).and_return("installation")

expect(Yast::Product.name).to eq("openSUSE (SELECTED)")
expect(Yast::Product.short_name).to eq("openSUSE")
expect(Yast::Product.version).to eq("13.1")
end
end

describe "when the mode is Update" do
it "reads product information from zypp and fills up internal variables" do
Yast::Mode.stub(:mode).and_return("update")

expect(Yast::Product.name).to eq("openSUSE (SELECTED)")
expect(Yast::Product.short_name).to eq("openSUSE")
expect(Yast::Product.version).to eq("13.1")
end
end
end

Expand Down

0 comments on commit a166484

Please sign in to comment.