Parent

Class Index [+]

Quicksearch

Spec::Runner::HeckleRunner

Creates a new Heckler configured to heckle all methods in the classes whose name matches filter


Dummy implementation for Windows that just fails (Heckle is not supported on Windows)

Public Class Methods

new(filter, heckle_class=Heckler) click to toggle source
    # File lib/spec/runner/heckle_runner.rb, line 12
12:         def initialize(filter, heckle_class=Heckler)
13:           @filter = filter
14:           @heckle_class = heckle_class
15:         end
new(filter) click to toggle source
   # File lib/spec/runner/heckle_runner_unsupported.rb, line 5
5:       def initialize(filter)
6:         raise "Heckle is not supported on Windows or Ruby 1.9"
7:       end

Public Instance Methods

heckle_class_or_module(class_or_module_name) click to toggle source
    # File lib/spec/runner/heckle_runner.rb, line 33
33:         def heckle_class_or_module(class_or_module_name)
34:           verify_constant(class_or_module_name)
35:           pattern = /^#{class_or_module_name}/
36:           classes = []
37:           ObjectSpace.each_object(Class) do |klass|
38:             classes << klass if klass.name =~ pattern
39:           end
40:         
41:           classes.each do |klass|
42:             klass.instance_methods(false).each do |method_name|
43:               heckle = @heckle_class.new(klass.name, method_name, Spec::Runner.options)
44:               heckle.validate
45:             end
46:           end
47:         end
heckle_method(class_name, method_name) click to toggle source
    # File lib/spec/runner/heckle_runner.rb, line 27
27:         def heckle_method(class_name, method_name)
28:           verify_constant(class_name)
29:           heckle = @heckle_class.new(class_name, method_name, Spec::Runner.options)
30:           heckle.validate
31:         end
heckle_with() click to toggle source

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 19
19:         def heckle_with
20:           if @filter =~ /(.*)[#\.](.*)/
21:             heckle_method($1, $2)
22:           else
23:             heckle_class_or_module(@filter)
24:           end
25:         end
verify_constant(name) click to toggle source
    # File lib/spec/runner/heckle_runner.rb, line 49
49:         def verify_constant(name)
50:           begin
51:             # This is defined in Heckle
52:             name.to_class
53:           rescue
54:             raise "Heckling failed - \"#{name}\" is not a known class or module"
55:           end
56:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.