Skip to content

Commit

Permalink
Fixed testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Apr 16, 2018
1 parent fb10a56 commit 6b204a3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
srcdir = File.expand_path("../../src", __FILE__)
y2dirs = ENV.fetch("Y2DIR", "").split(":")
ENV["Y2DIR"] = y2dirs.unshift(srcdir).join(":")

require "yast"
require "yast/rspec"

# Ensure the tests runs with english locales
ENV["LC_ALL"] = "en_US.UTF-8"

RSpec.configure do |c|
c.extend Yast::I18n # available in context/describe
c.include Yast::I18n
end

if ENV["COVERAGE"]
require "simplecov"
SimpleCov.start do
add_filter "/test/"
end

# for coverage we need to load all ruby files
src_location = File.expand_path("../../src", __FILE__)
Dir["#{src_location}/{module,lib}/**/*.rb"].each { |f| require_relative f }
# track all ruby files under src
SimpleCov.track_files("#{srcdir}/**/*.rb")

# use coveralls for on-line code coverage reporting at Travis CI
if ENV["TRAVIS"]
Expand Down
4 changes: 4 additions & 0 deletions test/yapi_dhcpd_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env rspec

require_relative "test_helper"

require "yast"

module Yast
import "YaPI::DHCPD"
import "Service"
Expand Down

0 comments on commit 6b204a3

Please sign in to comment.