File: basics.rb

package info (click to toggle)
libi18n-ruby 0.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 576 kB
  • ctags: 619
  • sloc: ruby: 4,655; makefile: 5
file content (24 lines) | stat: -rw-r--r-- 694 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# encoding: utf-8

module Tests
  module Api
    module Basics
      def test_available_locales
        store_translations('de', :foo => 'bar')
        store_translations('en', :foo => 'foo')

        assert I18n.available_locales.include?(:de)
        assert I18n.available_locales.include?(:en)
      end

      def test_delete_value
        store_translations(:to_be_deleted => 'bar')
        assert_equal 'bar', I18n.t('to_be_deleted', :default => 'baz')

        I18n.cache_store.clear if I18n.respond_to?(:cache_store) && I18n.cache_store
        store_translations(:to_be_deleted => nil)
        assert_equal 'baz', I18n.t('to_be_deleted', :default => 'baz')
      end
    end
  end
end