/test/test_helper.rb

https://github.com/snouhaud/click-to-globalize · Ruby · 27 lines · 23 code · 4 blank · 0 comment · 0 complexity · b22b9b41e723fd542dc5a518e2df5687 MD5 · raw file

  1. Test::Unit::TestCase.fixture_path = File.expand_path(File.dirname(__FILE__)) + "/fixtures/"
  2. $LOAD_PATH.unshift(Test::Unit::TestCase.fixture_path)
  3. Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, %w(countries languages translations).collect{|table_name| "globalize_#{table_name}"})
  4. class Test::Unit::TestCase
  5. def uses_config_file(config_file, &block)
  6. old_config_file = Locale.config_file
  7. Locale.config_file = old_config_file.gsub(/\w+\.\w+$/, config_file)
  8. Locale.configuration = false
  9. yield
  10. Locale.configuration = false
  11. Locale.config_file = old_config_file
  12. end
  13. end
  14. module Globalize #:nodoc:
  15. class Locale #:nodoc:
  16. cattr_writer :formatting, :configuration
  17. end
  18. module Helpers #:nodoc:
  19. def self.click_partial #:nodoc:
  20. @@click_partial
  21. end
  22. end
  23. end