| Class | Spec::Runner::HeckleRunner |
| In: |
lib/spec/runner/heckle_runner.rb
lib/spec/runner/heckle_runner_unsupported.rb |
| Parent: | Object |
Dummy implementation for Windows that just fails (Heckle is not supported on Windows)
# File lib/spec/runner/heckle_runner.rb, line 11
11: def initialize(filter, heckle_class=Heckler)
12: @filter = filter
13: @heckle_class = heckle_class
14: end
# File lib/spec/runner/heckle_runner_unsupported.rb, line 5 5: def initialize(filter) 6: raise "Heckle not supported on Windows" 7: end
# File lib/spec/runner/heckle_runner.rb, line 32
32: def heckle_class_or_module(class_or_module_name)
33: verify_constant(class_or_module_name)
34: pattern = /^#{class_or_module_name}/
35: classes = []
36: ObjectSpace.each_object(Class) do |klass|
37: classes << klass if klass.name =~ pattern
38: end
39:
40: classes.each do |klass|
41: klass.instance_methods(false).each do |method_name|
42: heckle = @heckle_class.new(klass.name, method_name, rspec_options)
43: heckle.validate
44: end
45: end
46: end
# File lib/spec/runner/heckle_runner.rb, line 26
26: def heckle_method(class_name, method_name)
27: verify_constant(class_name)
28: heckle = @heckle_class.new(class_name, method_name, rspec_options)
29: heckle.validate
30: end
Runs all the example groups held by rspec_options once for each of the methods in the matched classes.
# File lib/spec/runner/heckle_runner.rb, line 18
18: def heckle_with
19: if @filter =~ /(.*)[#\.](.*)/
20: heckle_method($1, $2)
21: else
22: heckle_class_or_module(@filter)
23: end
24: end