require 'rake/clean'
$:.unshift File.join(File.dirname(__FILE__), 'lib')
require 'fittask'
desc "Run Fit TaskLib"
Rake::FitTask.new(:fit) do |t|
# t.libs = ["lib/fit/*.rb"] # the fixture directory goes here
t.fail_on_failed_test = true
t.create_test_suite do |suite|
suite.test_path = 'doc/fitnesse/'
suite.report_path = 'doc/fitnesse/reports/'
test_files = Dir.glob(suite.test_path + '/*.html')
suite.tests = test_files.collect do |test_file|
{ :name => File.basename(test_file, '.html') }
end
end
examples = []
examples << { :name => 'arithmetic',
:right => 39, :wrong => 8, :ignores => 0, :exceptions => 2 }
examples << { :name => 'BinaryChop',
:right => 95, :wrong => 0, :ignores => 0, :exceptions => 0 }
examples << { :name => 'CalculatorExample',
:right => 75, :wrong => 9, :ignores => 0, :exceptions => 0 }
examples << { :name => 'MusicExample',
:right => 95, :wrong => 0, :ignores => 0, :exceptions => 0 }
examples << { :name => 'MusicExampleWithErrors',
:right => 54, :wrong => 10, :ignores => 0, :exceptions => 0 }
# WebPageExample is not here because it needs an active Internet connection
examples << { :name => 'NetworkExample',
:right => 5, :wrong => 0, :ignores => 0, :exceptions => 0 }
examples << { :name => 'ColumnIndex',
:right => 51, :wrong => 3, :ignores => 8, :exceptions => 0 }
examples << { :name => 'AllFiles',
:right => 9, :wrong => 3, :ignores => 0, :exceptions => 0 }
examples << { :name => 'AllCombinations',
:right => 72, :wrong => 14, :ignores => 0, :exceptions => 0 }
examples << { :name => 'AllPairs',
:right => 39, :wrong => 9, :ignores => 0, :exceptions => 0 }
# Running the ExampleTests.html file is roughly equivalent to this test suite
t.create_test_suite do |suite|
suite.test_path = "doc/examples/"
suite.report_path = "doc/reports/"
suite.tests = examples
end
t.test_suites.each do |suite|
CLOBBER.include(suite.report_path + "Report_*.html")
CLOBBER.include(suite.report_path + "footnotes/")
end
end
Rake::FitTask.new(:fitspec) do |t|
t.create_test_suite do |suite|
suite.test_path = "doc/spec/"
suite.report_path = "doc/spec/"
suite << { :name => 'parse',
:right => 70, :wrong => 0, :ignores => 0, :exceptions => 0 }
suite << { :name => 'annotation',
:right => 47, :wrong => 0, :ignores => 0, :exceptions => 0 }
end
end
require 'rake/testtask'
desc "Default task is to run FIT unit tests."
task :default => :test
desc "Run FIT unit tests."
Rake::TestTask.new do |t|
t.test_files = FileList['test/all_tests.rb']
t.verbose = true
t.libs = ['lib','test'] # verify why is needed
end
### RubyGems related stuff
require 'rake/gempackagetask'
spec = Gem::Specification.new do |s|
s.name = 'fit'
s.version = '1.1'
s.author = 'Giulio Piancastelli'
# See the README for other authors/developers/contributors
s.email = 'giulio.piancastelli@gmail.com'
s.homepage = 'http://fit.rubyforge.org/'
s.rubyforge_project = 'fit'
s.platform = Gem::Platform::RUBY
s.summary = 'A Ruby port of FIT (Framework for Integrated Testing)'
s.files = FileList["{bin,lib,test,doc}/**/*"].to_a + ["Rakefile"]
s.require_path = 'lib'
# s.autorequire something?
# set for executable scripts in the bin/ subdirectory
s.bindir = 'bin'
s.executables << 'fit'
s.test_file = 'test/all_tests.rb'
s.has_rdoc = false # no RDoc comments in the code
s.extra_rdoc_files = ["README.txt"]
# no external dependencies on other gems
end
# Cygwin's ln fails under my Windows installation
FileUtils::LN_SUPPORTED[0] = false
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar = true
pkg.need_zip = true
end