Skip to content

Commit

Permalink
Smoke test for AbortConfirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs authored and lslezak committed Aug 26, 2015
1 parent 1aa7476 commit 479f00c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/abort_confirmation_spec.rb
@@ -0,0 +1,34 @@
#! /usr/bin/env rspec

require_relative "spec_helper"

Yast.import "Popup"
Yast.import "Mode"

describe Registration::UI::AbortConfirmation do
describe ".run" do
subject(:run) { Registration::UI::AbortConfirmation.run }

before do
allow(Yast::Mode).to receive(:installation).and_return installation
end

context "during installation" do
let(:installation) { true }

it "returns the result of Popup.ConfirmAbort" do
expect(Yast::Popup).to receive(:ConfirmAbort).and_return "user decision"
expect(run).to eq "user decision"
end
end

context "during update or normal execution" do
let(:installation) { false }

it "returns the result of Popup.AnyQuestion" do
expect(Yast::Popup).to receive(:AnyQuestion).and_return "user decision"
expect(run).to eq "user decision"
end
end
end
end

0 comments on commit 479f00c

Please sign in to comment.