Skip to content

Commit

Permalink
Merge pull request #83 from yast/unify_module_mocks
Browse files Browse the repository at this point in the history
Unify YaST module mocking in unit tests
  • Loading branch information
lslezak committed Jan 21, 2022
2 parents 37a5024 + 1e2fea1 commit 032a734
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# YaST - The FTP Server Configuration Module #

[![Travis Build](https://travis-ci.org/yast/yast-ftp-server.svg?branch=master)](https://travis-ci.org/yast/yast-ftp-server)
[![Jenkins Build](http://img.shields.io/jenkins/s/https/ci.opensuse.org/yast-ftp-server-master.svg)](https://ci.opensuse.org/view/Yast/job/yast-ftp-server-master/)
[![Coverage Status](https://img.shields.io/coveralls/yast/yast-ftp-server/master.svg)](https://coveralls.io/github/yast/yast-ftp-server?branch=master)
[![Workflow Status](https://github.com/yast/yast-ftp-server/workflows/CI/badge.svg?branch=master)](
https://github.com/yast/yast-ftp-server/actions?query=branch%3Amaster)
[![Jenkins Status](https://ci.opensuse.org/buildStatus/icon?job=yast-yast-ftp-server-master)](
https://ci.opensuse.org/view/Yast/job/yast-yast-ftp-server-master/)
[![Coverage Status](https://coveralls.io/repos/github/yast/yast-ftp-server/badge.svg?branch=master)](
https://coveralls.io/github/yast/yast-ftp-server?branch=master)
6 changes: 6 additions & 0 deletions package/yast2-ftp-server.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jan 21 09:02:31 UTC 2022 - Ladislav Slezák <lslezak@suse.cz>

- Unify YaST module mocking in unit tests (related to bsc#1194784)
- 4.4.2

-------------------------------------------------------------------
Wed Jun 9 07:11:51 UTC 2021 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-ftp-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-ftp-server
Version: 4.4.1
Version: 4.4.2
Release: 0
Summary: YaST2 - FTP configuration
License: GPL-2.0-only
Expand Down
12 changes: 4 additions & 8 deletions test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@
ENV["LANG"] = "en_US.utf-8"

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

stub_module("Users")
require "yast/rspec"

RSpec.configure do |config|
config.mock_with :rspec do |c|
Expand Down Expand Up @@ -69,3 +62,6 @@ def stub_module(name)
]
end
end

# stub classes from other modules to avoid build dependencies
Yast::RSpec::Helpers.define_yast_module("Users")

0 comments on commit 032a734

Please sign in to comment.