lib/buildr/core/checks.rb in vic-buildr-1.3.1 vs lib/buildr/core/checks.rb in vic-buildr-1.3.3
- old
+ new
@@ -14,11 +14,11 @@
# the License.
require 'buildr/core/project'
require 'buildr/packaging/zip'
-require 'test/unit'
+#require 'test/unit'
require 'spec/matchers'
require 'spec/expectations'
module Buildr
@@ -128,11 +128,11 @@
end
# Run the expectation. We only print the expectation name when tracing (to know they all ran),
# or when we get a failure.
begin
- puts description if Buildr.application.options.trace
+ trace description
klass.new.instance_eval &@block
rescue Exception=>error
raise error.exception("#{description}\n#{error}").tap { |wrapped| wrapped.set_backtrace(error.backtrace) }
end
end
@@ -147,13 +147,13 @@
project.task("check") do |task|
project.expectations.inject(true) do |passed, expect|
begin
expect.run_against project
passed
- rescue Exception=>error
+ rescue Exception=>ex
if verbose
- puts error.backtrace.detect { |line| line =~ /#{Buildr.application.buildfile}/ } || ""
- puts error
+ error ex.backtrace.select { |line| line =~ /#{Buildr.application.buildfile}/ }.join("\n")
+ error ex
end
false
end
end or fail "Checks failed for project #{project.name} (see errors above)."
end