lib/shoulda/context/context.rb in shoulda-context-1.1.2 vs lib/shoulda/context/context.rb in shoulda-context-1.1.3
- old
+ new
@@ -383,11 +383,11 @@
def create_test_from_should_hash(should)
test_name = ["test:", full_name, "should", "#{should[:name]}. "].flatten.join(' ').to_sym
if test_methods[test_unit_class][test_name.to_s] then
- warn " * WARNING: '#{test_name}' is already defined"
+ raise DuplicateTestError, "'#{test_name}' is defined more than once."
end
test_methods[test_unit_class][test_name.to_s] = true
context = self
@@ -448,5 +448,7 @@
end
end
end
end
+
+class DuplicateTestError < RuntimeError; end