Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #60

Merged
merged 1 commit into from
Jul 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions test/modules/ftpserver_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@

require_relative "../spec_helper.rb"

# stub module to prevent its Import
# Useful for modules from different yast packages, to avoid build dependencies
def stub_module(name)
Yast.const_set name.to_sym, Class.new { def self.fake_method; end }
end

stub_module("Users")

Yast.import "FtpServer"
Expand Down
6 changes: 6 additions & 0 deletions test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@

require "yast"

# stub module to prevent its Import
# Useful for modules from different yast packages, to avoid build dependencies
def stub_module(name)
Yast.const_set name.to_sym, Class.new { def self.fake_method; end }
end

if ENV["COVERAGE"]
require "simplecov"
SimpleCov.start do
Expand Down
3 changes: 2 additions & 1 deletion test/y2ftp/clients/ftp_server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
require_relative "../../spec_helper.rb"
require "y2ftp/clients/ftp_server"

stub_module("Users")

describe Y2Ftp::Clients::FtpServer do
subject { described_class.new }

describe "#FTPdCMDShow" do
before do
allow(Yast::FtpServer).to receive(:EDIT_SETTINGS).and_return("AnonAuthen" => anon_authen)
allow(Yast::FtpServer).to receive(:main)

allow(Yast::CommandLine).to receive(:Print)
end
Expand Down