click-to-globalize /test/test_helper.rb

Language Ruby Lines 28
MD5 Hash b22b9b41e723fd542dc5a518e2df5687 Estimated Cost $515 (why?)
Repository https://github.com/snouhaud/click-to-globalize.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Test::Unit::TestCase.fixture_path = File.expand_path(File.dirname(__FILE__)) + "/fixtures/"
$LOAD_PATH.unshift(Test::Unit::TestCase.fixture_path)

Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, %w(countries languages translations).collect{|table_name| "globalize_#{table_name}"})

class Test::Unit::TestCase
  def uses_config_file(config_file, &block)
    old_config_file = Locale.config_file
    Locale.config_file = old_config_file.gsub(/\w+\.\w+$/, config_file)
    Locale.configuration = false
    yield
    Locale.configuration = false
    Locale.config_file = old_config_file
  end
end

module Globalize #:nodoc:
  class Locale #:nodoc:
    cattr_writer :formatting, :configuration
  end
  
  module Helpers #:nodoc:
    def self.click_partial #:nodoc:
      @@click_partial
    end
  end
end
Back to Top