test/test_helper.rb in coverband-5.2.6.rc.3 vs test/test_helper.rb in coverband-5.2.6.rc.4
- old
+ new
@@ -31,10 +31,11 @@
require "coverband/utils/file_list"
require "coverband/utils/source_file"
require "coverband/utils/lines_classifier"
require "coverband/utils/results"
require "coverband/reporters/html_report"
+require "coverband/reporters/json_report"
require "webmock/minitest"
require_relative "unique_files"
$VERBOSE = original_verbosity
@@ -91,16 +92,16 @@
Mocha::Configuration.prevent(:stubbing_non_existent_method)
def test(name, &block)
test_name = "test_#{name.gsub(/\s+/, "_")}".to_sym
defined = begin
- instance_method(test_name)
+ instance_method(test_name)
rescue
false
- end
+ end
raise "#{test_name} is already defined in #{self}" if defined
- if block_given?
+ if block
define_method(test_name, &block)
else
define_method(test_name) do
flunk "No implementation provided for #{name}"
end