Sha256: b9d18547b7a27c70a0cc955f782bd41a3bf2a37e15c48ba0ed35bc8c7bcfa325

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

#
# Copyright (c) 2014--2016 Red Hat Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
# along with this software; if not, see
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
#

require 'openscap'
require 'openscap/source'
require 'openscap/xccdf/tailoring'
require 'common/testcase'

class TailoringTest < OpenSCAP::TestCase
  def test_new_from_file
    tailoring = tailoring_from_file
    tailoring.destroy
    refute tailoring.raw
  end

  def test_profiles
    profiles = tailoring_from_file.profiles
    assert_equal 1, profiles.length
    assert profiles.values.first.is_a?(OpenSCAP::Xccdf::Profile)
  end

  private

  def tailoring_from_file
    source = OpenSCAP::Source.new '../data/tailoring.xml'
    tailoring = OpenSCAP::Xccdf::Tailoring.new source, nil
    source.destroy
    assert tailoring
    tailoring
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openscap-0.4.8 test/xccdf/tailoring_test.rb
openscap-0.4.7 test/xccdf/tailoring_test.rb