Skip to content

Commit

Permalink
updated tests after refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Sep 22, 2015
1 parent 2f7dfa5 commit d763bf5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion test/migration_finish_workflow_spec.rb
Expand Up @@ -6,7 +6,7 @@
describe "#run_sequence" do
it "restores the repository setup and returns :next" do
expect_any_instance_of(Registration::RepoStateStorage).to receive(:restore_all)
expect(subject.run).to eq(:next)
expect(subject.run_sequence).to eq(:next)
end
end
end
18 changes: 2 additions & 16 deletions test/migration_repos_workflow_spec.rb
Expand Up @@ -3,7 +3,7 @@
require_relative "spec_helper"

describe Registration::UI::MigrationReposWorkflow do
describe "#run" do
describe "#run_sequence" do
before do
# Url of the registration server
allow(Registration::UrlHelpers).to receive(:registration_url)
Expand All @@ -15,20 +15,6 @@
allow(Yast::Pkg).to receive(:SourceGetCurrent).and_return([])
end

it "aborts if package management initialization fails" do
msg = "Initialization failed"
expect(Registration::SwMgmt).to receive(:init).and_raise(Registration::PkgError, msg)

expect(subject.run).to eq(:abort)
end

it "handles any exception raised and reports an error" do
msg = "Something failed..."
expect(Yast::Sequencer).to receive(:Run).and_raise(msg)

expect(subject.run).to eq(:abort)
end

context "if package management initialization succeeds" do
let(:migrations) { load_yaml_fixture("migration_to_sles12_sp1.yml") }
let(:migration_service) { load_yaml_fixture("migration_service.yml") }
Expand Down Expand Up @@ -60,7 +46,7 @@

it "registers the selected migration products" do
set_success_expectations
expect(subject.run).to eq(:next)
expect(subject.run_sequence).to eq(:next)
end

it "displays the custom repository selection if required" do
Expand Down
4 changes: 2 additions & 2 deletions test/registration_sync_workflow_spec.rb
Expand Up @@ -3,7 +3,7 @@
require_relative "spec_helper"

describe Registration::UI::RegistrationSyncWorkflow do
describe "#run" do
describe "#run_sequence" do
before do
allow(Yast::Pkg).to receive(:SourceFinishAll)
allow(Yast::Pkg).to receive(:TargetFinish)
Expand All @@ -22,7 +22,7 @@
.with(installed_sles).and_return([true, nil])
expect_any_instance_of(Registration::RegistrationUI).to receive(:synchronize_products)
.with([installed_sles]).and_return(true)
expect(subject.run).to eq(:next)
expect(subject.run_sequence).to eq(:next)
end
end
end

0 comments on commit d763bf5

Please sign in to comment.