@@ -26,23 +26,27 @@ module FixtureSupport
26
26
end
27
27
28
28
module Fixtures
29
- def self . fixtures ( *args )
30
- orig_methods = private_instance_methods
31
- super . tap do
32
- new_methods = private_instance_methods - orig_methods
33
- new_methods . each do |method_name |
34
- proxy_method_warning_if_called_in_before_context_scope ( method_name )
29
+ extend ActiveSupport ::Concern
30
+
31
+ class_methods do
32
+ def fixtures ( *args )
33
+ orig_methods = private_instance_methods
34
+ super . tap do
35
+ new_methods = private_instance_methods - orig_methods
36
+ new_methods . each do |method_name |
37
+ proxy_method_warning_if_called_in_before_context_scope ( method_name )
38
+ end
35
39
end
36
40
end
37
- end
38
41
39
- def self . proxy_method_warning_if_called_in_before_context_scope ( method_name )
40
- orig_implementation = instance_method ( method_name )
41
- define_method ( method_name ) do |*args , &blk |
42
- if inspect . include? ( "before(:context)" )
43
- RSpec . warn_with ( "Calling fixture method in before :context " )
44
- else
45
- orig_implementation . bind ( self ) . call ( *args , &blk )
42
+ def proxy_method_warning_if_called_in_before_context_scope ( method_name )
43
+ orig_implementation = instance_method ( method_name )
44
+ define_method ( method_name ) do |*args , &blk |
45
+ if inspect . include? ( "before(:context)" )
46
+ RSpec . warn_with ( "Calling fixture method in before :context " )
47
+ else
48
+ orig_implementation . bind ( self ) . call ( *args , &blk )
49
+ end
46
50
end
47
51
end
48
52
end
0 commit comments