public
Description: Porting the original Framework for Integrated Tests written in Java to the Ruby world
Homepage: http://fit.rubyforge.org
Clone URL: git://github.com/rubbish/rubyfit.git
rubbish (author)
Thu Apr 03 18:44:17 -0700 2008
commit  62e116998852f06315dc705e2202668d84076279
tree    8a2c71ca1c9909ddf93e9e7132c415c661e0d543
parent  3c00f2046badbe852f4b3831133fd345d893ac36
rubyfit / Rakefile
100644 111 lines (96 sloc) 3.864 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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