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)

Methods

Public Class methods

[Source]

    # 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

[Source]

   # File lib/spec/runner/heckle_runner_unsupported.rb, line 5
5:       def initialize(filter)
6:         raise "Heckle not supported on Windows"
7:       end

Public Instance methods

[Source]

    # 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, behaviour_runner)
43:             heckle.validate
44:           end
45:         end
46:       end

[Source]

    # 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, behaviour_runner)
29:         heckle.validate
30:       end

Runs all the contexts held by behaviour_runner once for each of the methods in the matched classes.

[Source]

    # File lib/spec/runner/heckle_runner.rb, line 18
18:       def heckle_with(behaviour_runner)
19:         if @filter =~ /(.*)[#\.](.*)/
20:           heckle_method($1, $2)
21:         else
22:           heckle_class_or_module(@filter)
23:         end
24:       end

[Source]

    # File lib/spec/runner/heckle_runner.rb, line 48
48:       def verify_constant(name)
49:         begin
50:           # This is defined in Heckle
51:           name.to_class
52:         rescue
53:           raise "Heckling failed - \"#{name}\" is not a known class or module"
54:         end
55:       end

[Validate]