Skip to content

Commit

Permalink
fix dependency of tests on autoyast
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jan 5, 2015
1 parent 2006f91 commit a9ea480
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/proposal_runner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
require "installation/proposal_runner"

describe ::Installation::ProposalRunner do
before do
# mock constant to avoid dependency on autoyast
autoinst_config = double(:Confirm => false)
stub_const("Yast::AutoinstConfig", autoinst_config)
end

describe "#run" do

it "do nothing if run non-interactive" do
Yast.import "AutoinstConfig"
Yast.import "Mode"
allow(Yast::AutoinstConfig).to receive(:Confirm).and_return(false)
allow(Yast::Mode).to receive(:autoinst).and_return(true)

expect(subject.run).to eq :auto
Expand Down

0 comments on commit a9ea480

Please sign in to comment.