Sha256: a601b5bd346c972058d0907792dc894b3aa9e89254470dbe4ffe85c6e7928b8f
Contents?: true
Size: 993 Bytes
Versions: 29
Compression:
Stored size: 993 Bytes
Contents
require 'rib/test' require 'rib/all' describe Rib::Plugin do behaves_like :rib before do @names = Dir[File.expand_path( "#{File.dirname(__FILE__)}/../lib/rib/{core,more,zore}/*.rb")]. map {|path| File.basename(path)[0..-4] } @mods = Rib.plugins end should 'have shortcut methods' do @names.each{ |name| %w[enable disable].each{ |meth| Rib.respond_to?("#{meth}_#{name}").should == true } %w[enabled? disabled?].each{ |meth| Rib.respond_to?("#{name}_#{meth}").should == true } } end should 'be the same as mod methods' do @mods.shuffle.take(@mods.size/2).each(&:disable) @names.each{ |name| %w[enabled? disabled?].each{ |meth| Rib.send("#{name}_#{meth}").should == @mods.find{ |mod| mod.name[/::\w+$/].tr(':', '') == name.gsub(/([^_]+)/){$1.capitalize}.tr('_', '') }. send(meth) } } end end
Version data entries
29 entries across 29 versions & 1 rubygems