diff --git a/lib/minitest/ci.rb b/lib/minitest/ci.rb index ef94774..190b4c5 100644 --- a/lib/minitest/ci.rb +++ b/lib/minitest/ci.rb @@ -18,10 +18,12 @@ class << self # Clean the report_dir between test runs? (defaults to true) attr_accessor :clean + attr_accessor :working_dir end self.report_dir = 'test/reports' self.clean = true + self.working_dir = Dir.pwd attr_accessor :io attr_accessor :options @@ -81,6 +83,7 @@ def generate_results name, results end end + base = self.class.working_dir + '/' xml = [] xml << '' @@ -88,8 +91,8 @@ def generate_results name, results [total_time, skips, failures, errors, escape(name), assertions, results.count] results.each do |result| - xml << " " % - [result.time, escape(result.name), result.assertions] + xml << " " % + [result.time, escape(result.method(result.name).source_location[0].gsub(base, '')), escape(result.name), result.assertions] if failure = result.failure label = failure.result_label.downcase diff --git a/minitest_ci.gemspec b/minitest_ci.gemspec new file mode 100644 index 0000000..877a1e6 --- /dev/null +++ b/minitest_ci.gemspec @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = "minitest-ci" + s.version = "3.0.4.pre" + s.licenses = ['MIT'] + s.platform = Gem::Platform::RUBY + s.author = "bhenderson" + s.email = "henderson.bj@gmail.com" + s.homepage = "https://github.com/bhenderson/minitest-ci" + s.summary = "Minitest JUnit XML formatter" + s.description = "Minitest Junit XML results that Hudson can read." + + s.required_rubygems_version = ">= 1.3.6" + + s.add_dependency "minitest", '>= 5.0.6', '~> 5.0' + + s.files = Dir["lib/**/*"] + %w[README.txt] + s.require_path = "lib" +end +