PageRenderTime 85ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/amexsbs/railsapp/vendor/plugins/tab_tab/test/test_helper.rb

https://bitbucket.org/AcireStudios/social-app-demo
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
  1. $:.unshift(File.dirname(__FILE__) + '/../')
  2. require 'rubygems'
  3. require 'active_support'
  4. require 'active_support/test_case'
  5. require 'action_controller'
  6. require 'action_view'
  7. require 'action_view/helpers'
  8. require 'init'
  9. begin
  10. require 'ruby-debug'
  11. rescue LoadError
  12. puts "Install 'ruby-debug' to use the debugger during tests"
  13. end
  14. begin
  15. require 'redgreen'
  16. rescue LoadError
  17. puts "Install 'redgreen' to get color output during tests"
  18. end unless ENV['TM_BUNDLE_PATH']
  19. class Test::Unit::TestCase
  20. include TabTab
  21. require File.join(File.dirname(__FILE__), 'fixtures', 'ye_olde_view')
  22. require File.join(File.dirname(__FILE__), 'fixtures', 'bars_controller')
  23. require File.join(File.dirname(__FILE__), 'fixtures', 'stuff_controller')
  24. def assert_activation(tab_literal, *other_tab_literal)
  25. tab, other_tab = Tab.new(tab_literal), Tab.new(other_tab_literal)
  26. assert_block "#{tab.inspect} does not activate #{other_tab.inspect}" do
  27. tab.activates? other_tab
  28. end
  29. end
  30. def assert_no_activation(tab_literal, *other_tab_literal)
  31. tab, other_tab = Tab.new(tab_literal), Tab.new(other_tab_literal)
  32. assert_block "#{tab.inspect} activates #{other_tab.inspect}" do
  33. not tab.activates? other_tab
  34. end
  35. end
  36. end