1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/report-generators/test/tc_schedule_file.rb

39 lines
1.1 KiB
Ruby
Raw Normal View History

2010-07-28 16:20:38 +04:00
# Copyright (C) 2010 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2010-07-28 16:20:38 +04:00
require 'test/unit'
require 'pathname'
require 'schedule_file'
class TestScheduleFile < Test::Unit::TestCase
def test_reading
p = Pathname.new("report-generators/test/example.schedule")
p.open do |f|
s = Schedule.read(p.dirname, f)
assert_equal(3, s.schedules.size)
assert_equal(s.schedules[2].desc, "this comment is prefixed with whitespace")
assert_equal(s.schedules[0].command_line, "$TEST_TOOL ls")
end
end
def test_running
p = Pathname.new("report-generators/test/example.schedule")
p.open do |f|
s = Schedule.read(p.dirname, f)
s.run
s.schedules.each do |t|
assert(t.status.success?)
end
end
end
end