/
test_i18n.rb
52 lines (40 loc) · 1.31 KB
/
test_i18n.rb
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# -*- encoding: utf-8 -*-
require 'helper'
I18n.load_path << File.join(File.dirname(__FILE__), 'fixtures', 'locales', 'pt.yml')
describe "I18n" do
describe "when the locale is pt" do
before do
I18n.locale = :pt
end
it "should translate to segundo" do
assert_equal "segundo", Duration.new(:second => 1).format("%~s")
end
it "should translate to segundos" do
assert_equal "segundos", Duration.new.format("%~s")
end
it "should translate to minuto" do
assert_equal "minuto", Duration.new(:minute => 1).format("%~m")
end
it "should translate to minutos" do
assert_equal "minutos", Duration.new.format("%~m")
end
it "should translate to hora" do
assert_equal "hora", Duration.new(:hour => 1).format("%~h")
end
it "should translate to horas" do
assert_equal "horas", Duration.new.format("%~h")
end
it "should translate to dia" do
assert_equal "dia", Duration.new(:day => 1).format("%~d")
end
it "should translate to dias" do
assert_equal "dias", Duration.new.format("%~d")
end
it "should translate to semana" do
assert_equal "semana", Duration.new(:week => 1).format("%~w")
end
it "should translate to semanas" do
assert_equal "semanas", Duration.new.format("%~w")
end
end
end