Sha256: b5e0e3f6f9da7221184aea1f556e691e5d5bd5b4cf4b94803f2c6400e6fc5a72

Contents?: true

Size: 450 Bytes

Versions: 24

Compression:

Stored size: 450 Bytes

Contents

class Module
  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

  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
end

Version data entries

24 entries across 24 versions & 4 rubygems

Version Path
BanzaiMan-ZenTest-4.2 lib/focus.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/focus.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/focus.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/focus.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/focus.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/focus.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/focus.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/ZenTest-4.4.0/lib/focus.rb
zentest-without-autotest-4.4.0 lib/focus.rb
ZenTest-4.4.0 lib/focus.rb
ZenTest-4.3.3 lib/focus.rb
zentest-without-autotest-4.3.2 lib/focus.rb
ZenTest-4.3.2 lib/focus.rb
ZenTest-4.3.1 lib/focus.rb
ZenTest-4.3.0 lib/focus.rb
zentest-without-autotest-4.2.1 lib/focus.rb
zentest-without-autotest-4.1.4 lib/focus.rb
ZenTest-4.2.1 lib/focus.rb
ZenTest-4.2.0 lib/focus.rb
ZenTest-4.1.0 lib/focus.rb