Class: Buildr::JUnitTask
- Inherits:
-
Rake::Task
- Object
- Rake::Task
- Buildr::JUnitTask
- Defined in:
- lib/java/test.rb
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
Returns the value of attribute base_dir.
-
#classpath ⇒ Object
Returns the value of attribute classpath.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(*args) ⇒ JUnitTask
constructor
A new instance of JUnitTask.
- #real_classpath ⇒ Object
- #test_cases ⇒ Object
Constructor Details
#initialize(*args) ⇒ JUnitTask
Returns a new instance of JUnitTask.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/java/test.rb', line 9 def initialize(*args) super @classpath = [] enhance do |task| test_cases.each do |test| Dir.chdir base_dir java "junit.textui.TestRunner", test, :classpath=>real_classpath, :name=>"tests in #{test}" end end end |
Instance Attribute Details
#base_dir ⇒ Object
Returns the value of attribute base_dir.
5 6 7 |
# File 'lib/java/test.rb', line 5 def base_dir @base_dir end |
#classpath ⇒ Object
Returns the value of attribute classpath.
7 8 9 |
# File 'lib/java/test.rb', line 7 def classpath @classpath end |
#target ⇒ Object
Returns the value of attribute target.
6 7 8 |
# File 'lib/java/test.rb', line 6 def target @target end |
Instance Method Details
#real_classpath ⇒ Object
28 29 30 |
# File 'lib/java/test.rb', line 28 def real_classpath() @real_classpath ||= artifacts(@classpath).map(&:to_s) end |
#test_cases ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/java/test.rb', line 20 def test_cases() target = File.(self.target) return [] unless File.exist?(target) prefix = Regexp.new("^" + Regexp.escape(target) + "/") FileList[File.join(target, "**", "*Test.class")]. map { |path| path.sub(prefix, "").ext("").gsub(File::SEPARATOR, ".") }.sort end |