Skip to content

Commit

Permalink
Replaced Remote module by the new y2remote/remote class
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Dec 11, 2017
1 parent 83aaace commit 0852f01
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
7 changes: 4 additions & 3 deletions package/yast2-installation.spec
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-installation
Version: 4.0.16
Version: 4.0.17
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down Expand Up @@ -80,8 +80,9 @@ Requires: yast2-proxy
# writing settings in the first installation stage.
Requires: yast2-services-manager >= 3.2.1

## storage-ng based version
Requires: yast2-network >= 3.3.7
## y2remote based version
BuildRequires: yast2-network >= 4.0.13
Requires: yast2-network >= 4.0.13

# Augeas lenses
Requires: augeas-lenses
Expand Down
10 changes: 7 additions & 3 deletions src/lib/installation/remote_finish_client.rb
Expand Up @@ -16,6 +16,7 @@
# ------------------------------------------------------------------------------

require "yast"
require "y2remote/remote"

module Installation
# Step of base installation finish for remote administration (VNC)
Expand All @@ -25,7 +26,6 @@ class RemoteFinishClient

def initialize
Yast.import "Linuxrc"
Yast.import "Remote"
textdomain "installation"
end

Expand Down Expand Up @@ -76,8 +76,12 @@ def modes

# Enables remote access
def enable_remote
Yast::Remote.Enable
Yast::Remote.Write
remote.enable!
remote.write
end

def remote
@remote ||= Y2Remote::Remote.instance
end
end
end
9 changes: 4 additions & 5 deletions test/remote_finish_test.rb
Expand Up @@ -8,9 +8,7 @@ module Yast
import "Linuxrc"

describe ::Installation::RemoteFinishClient do
before do
stub_const("Yast::Remote", double)
end
let(:remote) { Y2Remote::Remote.instance }

subject { ::Installation::RemoteFinishClient.new }

Expand Down Expand Up @@ -56,8 +54,9 @@ module Yast

describe "#enable_remote" do
it "enables remote access" do
expect(Remote).to receive(:Enable)
expect(Remote).to receive(:Write)
expect(remote).to receive(:enable!)
expect(remote).to receive(:write)

subject.enable_remote
end
end
Expand Down

0 comments on commit 0852f01

Please sign in to comment.