We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8c4fde commit be8001aCopy full SHA for be8001a
spec/spec_helper.rb
@@ -97,4 +97,22 @@
97
# as the one that triggered the failure.
98
Kernel.srand config.seed
99
=end
100
+
101
+ config.add_setting :relies_on
102
103
+ config.before(:suite) do
104
+ config.relies_on = reckon_relies_on
105
+ end
106
+end
107
108
+def reckon_relies_on
109
+ relies_on = Hash.new { |hash, key| hash[key] = [] }
110
+ ObjectSpace.each_object(Class).select { |klass| klass < RSpec::Core::ExampleGroup }.each do |klass|
111
+ instance = klass.new
112
+ next unless instance.respond_to?(:relies_on)
113
114
+ relies_on_key = instance.method(:relies_on).call
115
+ relies_on[relies_on_key] << klass
116
117
+ relies_on
118
end
0 commit comments