Skip to content

Commit 8a6efaa

Browse files
author
Anna
committed
fix coerced tests when files are run individually
1 parent 20f4190 commit 8a6efaa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/cases/sqlserver_helper.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,22 @@ module SqlserverCoercedTest
9898
def self.included(base)
9999
base.extend ClassMethods
100100
end
101+
101102
module ClassMethods
103+
104+
def self.extended(base)
105+
base.class_eval do
106+
Array(coerced_tests).each do |method_name|
107+
undef_method(method_name) rescue nil
108+
STDOUT.puts("Info: Undefined coerced test: #{self.name}##{method_name}")
109+
end
110+
end
111+
end
112+
102113
def coerced_tests
103114
self.const_get(:COERCED_TESTS) rescue nil
104115
end
116+
105117
def method_added(method)
106118
if coerced_tests && coerced_tests.include?(method)
107119
undef_method(method) rescue nil

0 commit comments

Comments
 (0)