Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/focus.rb,
lib/zentest.rb

Instance Method Summary collapse

Instance Method Details

#blurObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/focus.rb', line 10

def blur
  parent = self.superclass

  ObjectSpace.each_object Class do |klass|
    next unless parent > klass
    next if klass == self

    klass.send :focus
    klass.send :undef_method, :default_test
  end
end

#focus(*wanteds) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/focus.rb', line 2

def focus *wanteds
  wanteds.map! { |m| m.to_s }
  unwanteds = public_instance_methods(false).grep(/test_/) - wanteds
  unwanteds.each do |unwanted|
    remove_method unwanted
  end
end

#zentestObject



25
26
27
# File 'lib/zentest.rb', line 25

def zentest
  at_exit { ZenTest.autotest(self) }
end