forked from yast/yast-installation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproposal_errors_test.rb
executable file
·33 lines (25 loc) · 1.01 KB
/
proposal_errors_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /usr/bin/env rspec
require_relative "./test_helper"
require "installation/proposal_errors"
describe ::Installation::ProposalErrors do
describe "#approved?" do
it "returns true if there is no error stored" do
expect(Yast::Popup).to_not receive(:ErrorAnyQuestion)
expect(subject.approved?).to eq true
end
it "asks user to approve errors and returns true if approved" do
subject.append("test")
expect(Yast::Popup).to receive(:ErrorAnyQuestion).and_return(false)
expect(subject.approved?).to eq true
expect(Yast::Popup).to receive(:ErrorAnyQuestion).and_return(true)
expect(subject.approved?).to eq false
end
it "in autoyast ask with timeout and return true if timeout exceed" do
subject.append("test")
allow(Yast::Mode).to receive(:auto).and_return(true)
# timed error return false when timeout exceed
expect(Yast::Popup).to receive(:TimedErrorAnyQuestion).and_return(false)
expect(subject.approved?).to eq true
end
end
end