/amexsbs/railsapp/vendor/plugins/tab_tab/test/test_helper.rb
Ruby | 46 lines | 36 code | 10 blank | 0 comment | 0 complexity | 9466310bafff969f659e1ff067b7d6f0 MD5 | raw file
Possible License(s): GPL-2.0, MPL-2.0-no-copyleft-exception, MIT
- $:.unshift(File.dirname(__FILE__) + '/../')
- require 'rubygems'
- require 'active_support'
- require 'active_support/test_case'
- require 'action_controller'
- require 'action_view'
- require 'action_view/helpers'
- require 'init'
- begin
- require 'ruby-debug'
- rescue LoadError
- puts "Install 'ruby-debug' to use the debugger during tests"
- end
- begin
- require 'redgreen'
- rescue LoadError
- puts "Install 'redgreen' to get color output during tests"
- end unless ENV['TM_BUNDLE_PATH']
- class Test::Unit::TestCase
- include TabTab
- require File.join(File.dirname(__FILE__), 'fixtures', 'ye_olde_view')
- require File.join(File.dirname(__FILE__), 'fixtures', 'bars_controller')
- require File.join(File.dirname(__FILE__), 'fixtures', 'stuff_controller')
- def assert_activation(tab_literal, *other_tab_literal)
- tab, other_tab = Tab.new(tab_literal), Tab.new(other_tab_literal)
- assert_block "#{tab.inspect} does not activate #{other_tab.inspect}" do
- tab.activates? other_tab
- end
- end
- def assert_no_activation(tab_literal, *other_tab_literal)
- tab, other_tab = Tab.new(tab_literal), Tab.new(other_tab_literal)
- assert_block "#{tab.inspect} activates #{other_tab.inspect}" do
- not tab.activates? other_tab
- end
- end
- end