twitter_cldr 3.0.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -2
  3. data/History.txt +4 -0
  4. data/README.md +17 -6
  5. data/lib/twitter_cldr/resources/postal_codes_importer.rb +12 -1
  6. data/lib/twitter_cldr/resources/regexp_ast_generator.rb +41 -0
  7. data/lib/twitter_cldr/resources.rb +1 -0
  8. data/lib/twitter_cldr/shared/postal_code_generator.rb +50 -0
  9. data/lib/twitter_cldr/shared/postal_codes.rb +48 -9
  10. data/lib/twitter_cldr/shared.rb +15 -14
  11. data/lib/twitter_cldr/utils/regexp_ast.rb +115 -0
  12. data/lib/twitter_cldr/utils/regexp_sampler.rb +149 -0
  13. data/lib/twitter_cldr/utils.rb +5 -3
  14. data/lib/twitter_cldr/version.rb +1 -1
  15. data/resources/shared/postal_codes.yml +1442 -159
  16. data/spec/bidi/bidi_spec.rb +1 -1
  17. data/spec/collation/collation_spec.rb +1 -1
  18. data/spec/collation/collator_spec.rb +31 -31
  19. data/spec/collation/implicit_collation_elements_spec.rb +6 -6
  20. data/spec/collation/sort_key_builder_spec.rb +28 -26
  21. data/spec/collation/tailoring_spec.rb +1 -1
  22. data/spec/collation/trie_builder_spec.rb +16 -16
  23. data/spec/collation/trie_dumps_spec.rb +2 -2
  24. data/spec/collation/trie_loader_spec.rb +8 -8
  25. data/spec/collation/trie_spec.rb +61 -61
  26. data/spec/collation/trie_with_fallback_spec.rb +5 -5
  27. data/spec/core_ext_spec.rb +1 -1
  28. data/spec/data_readers/additional_date_format_selector_spec.rb +38 -38
  29. data/spec/data_readers/date_time_data_reader_spec.rb +2 -2
  30. data/spec/data_readers/number_data_reader_spec.rb +1 -1
  31. data/spec/formatters/calendars/datetime_formatter_spec.rb +218 -218
  32. data/spec/formatters/list_formatter_spec.rb +8 -8
  33. data/spec/formatters/numbers/abbreviated/abbreviated_number_formatter_spec.rb +14 -14
  34. data/spec/formatters/numbers/abbreviated/long_decimal_formatter_spec.rb +4 -4
  35. data/spec/formatters/numbers/abbreviated/short_decimal_formatter_spec.rb +4 -4
  36. data/spec/formatters/numbers/currency_formatter_spec.rb +11 -11
  37. data/spec/formatters/numbers/decimal_formatter_spec.rb +3 -3
  38. data/spec/formatters/numbers/helpers/fraction_spec.rb +3 -3
  39. data/spec/formatters/numbers/helpers/integer_spec.rb +16 -16
  40. data/spec/formatters/numbers/number_formatter_spec.rb +21 -21
  41. data/spec/formatters/numbers/percent_formatter_spec.rb +3 -3
  42. data/spec/formatters/numbers/rbnf/rbnf_spec.rb +2 -2
  43. data/spec/formatters/plurals/plural_formatter_spec.rb +41 -41
  44. data/spec/formatters/plurals/rules_spec.rb +13 -13
  45. data/spec/localized/localized_array_spec.rb +12 -12
  46. data/spec/localized/localized_date_spec.rb +33 -33
  47. data/spec/localized/localized_datetime_spec.rb +11 -11
  48. data/spec/localized/localized_hash_spec.rb +4 -4
  49. data/spec/localized/localized_number_spec.rb +36 -36
  50. data/spec/localized/localized_object_spec.rb +8 -8
  51. data/spec/localized/localized_string_spec.rb +53 -53
  52. data/spec/localized/localized_symbol_spec.rb +9 -9
  53. data/spec/localized/localized_time_spec.rb +10 -10
  54. data/spec/localized/localized_timespan_spec.rb +8 -8
  55. data/spec/normalization_spec.rb +6 -6
  56. data/spec/parsers/number_parser_spec.rb +36 -36
  57. data/spec/parsers/parser_spec.rb +5 -5
  58. data/spec/parsers/segmentation_parser_spec.rb +19 -19
  59. data/spec/parsers/symbol_table_spec.rb +4 -4
  60. data/spec/parsers/unicode_regex/character_class_spec.rb +19 -19
  61. data/spec/parsers/unicode_regex/character_range_spec.rb +1 -1
  62. data/spec/parsers/unicode_regex/character_set_spec.rb +8 -8
  63. data/spec/parsers/unicode_regex/literal_spec.rb +5 -5
  64. data/spec/parsers/unicode_regex/unicode_string_spec.rb +2 -2
  65. data/spec/parsers/unicode_regex_parser_spec.rb +28 -28
  66. data/spec/resources/loader_spec.rb +32 -32
  67. data/spec/shared/break_iterator_spec.rb +13 -13
  68. data/spec/shared/calendar_spec.rb +59 -59
  69. data/spec/shared/casefolder_spec.rb +5 -5
  70. data/spec/shared/code_point_spec.rb +46 -46
  71. data/spec/shared/currencies_spec.rb +7 -7
  72. data/spec/shared/language_codes_spec.rb +34 -34
  73. data/spec/shared/languages_spec.rb +30 -30
  74. data/spec/shared/numbering_system_spec.rb +7 -7
  75. data/spec/shared/numbers_spec.rb +4 -4
  76. data/spec/shared/phone_codes_spec.rb +7 -7
  77. data/spec/shared/postal_code_generator_spec.rb +76 -0
  78. data/spec/shared/postal_codes_spec.rb +35 -29
  79. data/spec/shared/territories_spec.rb +40 -40
  80. data/spec/shared/unicode_regex_spec.rb +71 -71
  81. data/spec/spec_helper.rb +2 -2
  82. data/spec/tokenizers/calendars/date_tokenizer_spec.rb +1 -1
  83. data/spec/tokenizers/calendars/timespan_tokenizer_spec.rb +6 -6
  84. data/spec/tokenizers/composite_token_spec.rb +3 -3
  85. data/spec/tokenizers/token_spec.rb +3 -3
  86. data/spec/twitter_cldr_spec.rb +72 -72
  87. data/spec/utils/code_points_spec.rb +10 -10
  88. data/spec/utils/interpolation_spec.rb +32 -32
  89. data/spec/utils/range_set_spec.rb +36 -36
  90. data/spec/utils/regexp_ast_spec.rb +44 -0
  91. data/spec/utils/regexp_sampler_spec.rb +182 -0
  92. data/spec/utils/yaml/yaml_spec.rb +23 -23
  93. data/spec/utils_spec.rb +19 -19
  94. metadata +263 -258
@@ -15,381 +15,381 @@ describe DateTimeFormatter do
15
15
 
16
16
  describe "#day" do
17
17
  it "test: pattern d" do
18
- @formatter.send(:day, Date.new(2010, 1, 1), 'd', 1).should == '1'
19
- @formatter.send(:day, Date.new(2010, 1, 10), 'd', 1).should == '10'
18
+ expect(@formatter.send(:day, Date.new(2010, 1, 1), 'd', 1)).to eq('1')
19
+ expect(@formatter.send(:day, Date.new(2010, 1, 10), 'd', 1)).to eq('10')
20
20
  end
21
21
 
22
22
  it "test: pattern dd" do
23
- @formatter.send(:day, Date.new(2010, 1, 1), 'dd', 2).should == '01'
24
- @formatter.send(:day, Date.new(2010, 1, 10), 'dd', 2).should == '10'
23
+ expect(@formatter.send(:day, Date.new(2010, 1, 1), 'dd', 2)).to eq('01')
24
+ expect(@formatter.send(:day, Date.new(2010, 1, 10), 'dd', 2)).to eq('10')
25
25
  end
26
26
  end
27
27
 
28
28
  describe "#weekday_local_stand_alone" do
29
29
  it "test: pattern c" do
30
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 4), 'c', 1).should == '1'
31
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 5), 'c', 1).should == '2'
32
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 10), 'c', 1).should == '7'
30
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 4), 'c', 1)).to eq('1')
31
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 5), 'c', 1)).to eq('2')
32
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 10), 'c', 1)).to eq('7')
33
33
  end
34
34
 
35
35
  it "test: pattern cc" do
36
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 4), 'cc', 2).should == 'Mo.'
37
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 5), 'cc', 2).should == 'Di.'
38
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 10), 'cc', 2).should == 'So.'
36
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 4), 'cc', 2)).to eq('Mo.')
37
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 5), 'cc', 2)).to eq('Di.')
38
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 10), 'cc', 2)).to eq('So.')
39
39
  end
40
40
 
41
41
  it "test: pattern ccc" do
42
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 4), 'ccc', 3).should == 'Mo.'
43
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 5), 'ccc', 3).should == 'Di.'
44
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 10), 'ccc', 3).should == 'So.'
42
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 4), 'ccc', 3)).to eq('Mo.')
43
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 5), 'ccc', 3)).to eq('Di.')
44
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 10), 'ccc', 3)).to eq('So.')
45
45
  end
46
46
 
47
47
  it "test: pattern cccc" do
48
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 4), 'cccc', 4).should == 'Montag'
49
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 5), 'cccc', 4).should == 'Dienstag'
50
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 10), 'cccc', 4).should == 'Sonntag'
48
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 4), 'cccc', 4)).to eq('Montag')
49
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 5), 'cccc', 4)).to eq('Dienstag')
50
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 10), 'cccc', 4)).to eq('Sonntag')
51
51
  end
52
52
 
53
53
  it "test: pattern ccccc" do
54
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 4), 'ccccc', 5).should == 'M'
55
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 5), 'ccccc', 5).should == 'D'
56
- @formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 10), 'ccccc', 5).should == 'S'
54
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 4), 'ccccc', 5)).to eq('M')
55
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 5), 'ccccc', 5)).to eq('D')
56
+ expect(@formatter.send(:weekday_local_stand_alone, Date.new(2010, 1, 10), 'ccccc', 5)).to eq('S')
57
57
  end
58
58
  end
59
59
 
60
60
  describe "#weekday_local" do
61
61
  it "test: pattern e" do
62
- @formatter.send(:weekday_local, Date.new(2010, 1, 4), 'e', 1).should == '1'
63
- @formatter.send(:weekday_local, Date.new(2010, 1, 5), 'e', 1).should == '2'
64
- @formatter.send(:weekday_local, Date.new(2010, 1, 10), 'e', 1).should == '7'
62
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 4), 'e', 1)).to eq('1')
63
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 5), 'e', 1)).to eq('2')
64
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 10), 'e', 1)).to eq('7')
65
65
  end
66
66
 
67
67
  it "test: pattern ee" do
68
- @formatter.send(:weekday_local, Date.new(2010, 1, 4), 'ee', 2).should == '1'
69
- @formatter.send(:weekday_local, Date.new(2010, 1, 5), 'ee', 2).should == '2'
70
- @formatter.send(:weekday_local, Date.new(2010, 1, 10), 'ee', 2).should == '7'
68
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 4), 'ee', 2)).to eq('1')
69
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 5), 'ee', 2)).to eq('2')
70
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 10), 'ee', 2)).to eq('7')
71
71
  end
72
72
 
73
73
  it "test: pattern eee" do
74
- @formatter.send(:weekday_local, Date.new(2010, 1, 4), 'eee', 3).should == 'Mo.'
75
- @formatter.send(:weekday_local, Date.new(2010, 1, 5), 'eee', 3).should == 'Di.'
76
- @formatter.send(:weekday_local, Date.new(2010, 1, 10), 'eee', 3).should == 'So.'
74
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 4), 'eee', 3)).to eq('Mo.')
75
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 5), 'eee', 3)).to eq('Di.')
76
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 10), 'eee', 3)).to eq('So.')
77
77
  end
78
78
 
79
79
  it "test: pattern eeee" do
80
- @formatter.send(:weekday_local, Date.new(2010, 1, 4), 'eeee', 4).should == 'Montag'
81
- @formatter.send(:weekday_local, Date.new(2010, 1, 5), 'eeee', 4).should == 'Dienstag'
82
- @formatter.send(:weekday_local, Date.new(2010, 1, 10), 'eeee', 4).should == 'Sonntag'
80
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 4), 'eeee', 4)).to eq('Montag')
81
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 5), 'eeee', 4)).to eq('Dienstag')
82
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 10), 'eeee', 4)).to eq('Sonntag')
83
83
  end
84
84
 
85
85
  it "test: pattern eeeee" do
86
- @formatter.send(:weekday_local, Date.new(2010, 1, 4), 'eeeee', 5).should == 'M'
87
- @formatter.send(:weekday_local, Date.new(2010, 1, 5), 'eeeee', 5).should == 'D'
88
- @formatter.send(:weekday_local, Date.new(2010, 1, 10), 'eeeee', 5).should == 'S'
86
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 4), 'eeeee', 5)).to eq('M')
87
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 5), 'eeeee', 5)).to eq('D')
88
+ expect(@formatter.send(:weekday_local, Date.new(2010, 1, 10), 'eeeee', 5)).to eq('S')
89
89
  end
90
90
  end
91
91
 
92
92
  describe "#weekday" do
93
93
  it "test: pattern E, EE, EEE" do
94
- @formatter.send(:weekday, Date.new(2010, 1, 1), 'E', 1).should == 'Fr.'
95
- @formatter.send(:weekday, Date.new(2010, 1, 1), 'EE', 2).should == 'Fr.'
96
- @formatter.send(:weekday, Date.new(2010, 1, 1), 'EEE', 3).should == 'Fr.'
94
+ expect(@formatter.send(:weekday, Date.new(2010, 1, 1), 'E', 1)).to eq('Fr.')
95
+ expect(@formatter.send(:weekday, Date.new(2010, 1, 1), 'EE', 2)).to eq('Fr.')
96
+ expect(@formatter.send(:weekday, Date.new(2010, 1, 1), 'EEE', 3)).to eq('Fr.')
97
97
  end
98
98
 
99
99
  it "test: pattern EEEE" do
100
- @formatter.send(:weekday, Date.new(2010, 1, 1), 'EEEE', 4).should == 'Freitag'
100
+ expect(@formatter.send(:weekday, Date.new(2010, 1, 1), 'EEEE', 4)).to eq('Freitag')
101
101
  end
102
102
 
103
103
  it "test: pattern EEEEE" do
104
- @formatter.send(:weekday, Date.new(2010, 1, 1), 'EEEEE', 5).should == 'F'
104
+ expect(@formatter.send(:weekday, Date.new(2010, 1, 1), 'EEEEE', 5)).to eq('F')
105
105
  end
106
106
  end
107
107
 
108
108
  describe "#hour" do
109
109
  it "test: h" do
110
- @formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'h', 1).should == '12'
111
- @formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'h', 1).should == '1'
112
- @formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'h', 1).should == '11'
113
- @formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'h', 1).should == '12'
114
- @formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'h', 1).should == '11'
110
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'h', 1)).to eq('12')
111
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'h', 1)).to eq('1')
112
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'h', 1)).to eq('11')
113
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'h', 1)).to eq('12')
114
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'h', 1)).to eq('11')
115
115
  end
116
116
 
117
117
  it "test: hh" do
118
- @formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'hh', 2).should == '12'
119
- @formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'hh', 2).should == '01'
120
- @formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'hh', 2).should == '11'
121
- @formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'hh', 2).should == '12'
122
- @formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'hh', 2).should == '11'
118
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'hh', 2)).to eq('12')
119
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'hh', 2)).to eq('01')
120
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'hh', 2)).to eq('11')
121
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'hh', 2)).to eq('12')
122
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'hh', 2)).to eq('11')
123
123
  end
124
124
 
125
125
  it "test: H" do
126
- @formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'H', 1).should == '0'
127
- @formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'H', 1).should == '1'
128
- @formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'H', 1).should == '11'
129
- @formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'H', 1).should == '12'
130
- @formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'H', 1).should == '23'
126
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'H', 1)).to eq('0')
127
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'H', 1)).to eq('1')
128
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'H', 1)).to eq('11')
129
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'H', 1)).to eq('12')
130
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'H', 1)).to eq('23')
131
131
  end
132
132
 
133
133
  it "test: HH" do
134
- @formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'HH', 2).should == '00'
135
- @formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'HH', 2).should == '01'
136
- @formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'HH', 2).should == '11'
137
- @formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'HH', 2).should == '12'
138
- @formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'HH', 2).should == '23'
134
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'HH', 2)).to eq('00')
135
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'HH', 2)).to eq('01')
136
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'HH', 2)).to eq('11')
137
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'HH', 2)).to eq('12')
138
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'HH', 2)).to eq('23')
139
139
  end
140
140
 
141
141
  it "test: K" do
142
- @formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'K', 1).should == '0'
143
- @formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'K', 1).should == '1'
144
- @formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'K', 1).should == '11'
145
- @formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'K', 1).should == '0'
146
- @formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'K', 1).should == '11'
142
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'K', 1)).to eq('0')
143
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'K', 1)).to eq('1')
144
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'K', 1)).to eq('11')
145
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'K', 1)).to eq('0')
146
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'K', 1)).to eq('11')
147
147
  end
148
148
 
149
149
  it "test: KK" do
150
- @formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'KK', 2).should == '00'
151
- @formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'KK', 2).should == '01'
152
- @formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'KK', 2).should == '11'
153
- @formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'KK', 2).should == '00'
154
- @formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'KK', 2).should == '11'
150
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'KK', 2)).to eq('00')
151
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'KK', 2)).to eq('01')
152
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'KK', 2)).to eq('11')
153
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'KK', 2)).to eq('00')
154
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'KK', 2)).to eq('11')
155
155
  end
156
156
 
157
157
  it "test: k" do
158
- @formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'k', 1).should == '24'
159
- @formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'k', 1).should == '1'
160
- @formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'k', 1).should == '11'
161
- @formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'k', 1).should == '12'
162
- @formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'k', 1).should == '23'
158
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'k', 1)).to eq('24')
159
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'k', 1)).to eq('1')
160
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'k', 1)).to eq('11')
161
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'k', 1)).to eq('12')
162
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'k', 1)).to eq('23')
163
163
  end
164
164
 
165
165
  it "test: kk" do
166
- @formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'kk', 2).should == '24'
167
- @formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'kk', 2).should == '01'
168
- @formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'kk', 2).should == '11'
169
- @formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'kk', 2).should == '12'
170
- @formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'kk', 2).should == '23'
166
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 0, 1, 1), 'kk', 2)).to eq('24')
167
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 1, 1, 1), 'kk', 2)).to eq('01')
168
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 11, 1, 1), 'kk', 2)).to eq('11')
169
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 12, 1, 1), 'kk', 2)).to eq('12')
170
+ expect(@formatter.send(:hour, Time.local(2000, 1, 1, 23, 1, 1), 'kk', 2)).to eq('23')
171
171
  end
172
172
  end
173
173
 
174
174
  describe "#minute" do
175
175
  it "test: m" do
176
- @formatter.send(:minute, Time.local(2000, 1, 1, 1, 1, 1), 'm', 1).should == '1'
177
- @formatter.send(:minute, Time.local(2000, 1, 1, 1, 11, 1), 'm', 1).should == '11'
176
+ expect(@formatter.send(:minute, Time.local(2000, 1, 1, 1, 1, 1), 'm', 1)).to eq('1')
177
+ expect(@formatter.send(:minute, Time.local(2000, 1, 1, 1, 11, 1), 'm', 1)).to eq('11')
178
178
  end
179
179
 
180
180
  it "test: mm" do
181
- @formatter.send(:minute, Time.local(2000, 1, 1, 1, 1, 1), 'mm', 2).should == '01'
182
- @formatter.send(:minute, Time.local(2000, 1, 1, 1, 11, 1), 'mm', 2).should == '11'
181
+ expect(@formatter.send(:minute, Time.local(2000, 1, 1, 1, 1, 1), 'mm', 2)).to eq('01')
182
+ expect(@formatter.send(:minute, Time.local(2000, 1, 1, 1, 11, 1), 'mm', 2)).to eq('11')
183
183
  end
184
184
  end
185
185
 
186
186
  describe "#month" do
187
187
  it "test: pattern M" do
188
- @formatter.send(:month, Date.new(2010, 1, 1), 'M', 1).should == '1'
189
- @formatter.send(:month, Date.new(2010, 10, 1), 'M', 1).should == '10'
188
+ expect(@formatter.send(:month, Date.new(2010, 1, 1), 'M', 1)).to eq('1')
189
+ expect(@formatter.send(:month, Date.new(2010, 10, 1), 'M', 1)).to eq('10')
190
190
  end
191
191
 
192
192
  it "test: pattern MM" do
193
- @formatter.send(:month, Date.new(2010, 1, 1), 'MM', 2).should == '01'
194
- @formatter.send(:month, Date.new(2010, 10, 1), 'MM', 2).should == '10'
193
+ expect(@formatter.send(:month, Date.new(2010, 1, 1), 'MM', 2)).to eq('01')
194
+ expect(@formatter.send(:month, Date.new(2010, 10, 1), 'MM', 2)).to eq('10')
195
195
  end
196
196
 
197
197
  it "test: pattern MMM" do
198
- @formatter.send(:month, Date.new(2010, 1, 1), 'MMM', 3).should == 'Jan.'
199
- @formatter.send(:month, Date.new(2010, 10, 1), 'MMM', 3).should == 'Okt.'
198
+ expect(@formatter.send(:month, Date.new(2010, 1, 1), 'MMM', 3)).to eq('Jan.')
199
+ expect(@formatter.send(:month, Date.new(2010, 10, 1), 'MMM', 3)).to eq('Okt.')
200
200
  end
201
201
 
202
202
  it "test: pattern MMMM" do
203
- @formatter.send(:month, Date.new(2010, 1, 1), 'MMMM', 4).should == 'Januar'
204
- @formatter.send(:month, Date.new(2010, 10, 1), 'MMMM', 4).should == 'Oktober'
203
+ expect(@formatter.send(:month, Date.new(2010, 1, 1), 'MMMM', 4)).to eq('Januar')
204
+ expect(@formatter.send(:month, Date.new(2010, 10, 1), 'MMMM', 4)).to eq('Oktober')
205
205
  end
206
206
 
207
207
  it "test: pattern L" do
208
- @formatter.send(:month, Date.new(2010, 1, 1), 'L', 1).should == '1'
209
- @formatter.send(:month, Date.new(2010, 10, 1), 'L', 1).should == '10'
208
+ expect(@formatter.send(:month, Date.new(2010, 1, 1), 'L', 1)).to eq('1')
209
+ expect(@formatter.send(:month, Date.new(2010, 10, 1), 'L', 1)).to eq('10')
210
210
  end
211
211
 
212
212
  it "test: pattern LL" do
213
- @formatter.send(:month, Date.new(2010, 1, 1), 'LL', 2).should == '01'
214
- @formatter.send(:month, Date.new(2010, 10, 1), 'LL', 2).should == '10'
213
+ expect(@formatter.send(:month, Date.new(2010, 1, 1), 'LL', 2)).to eq('01')
214
+ expect(@formatter.send(:month, Date.new(2010, 10, 1), 'LL', 2)).to eq('10')
215
215
  end
216
216
  end
217
217
 
218
218
  describe "#period" do
219
219
  it "test: a" do
220
- @formatter.send(:period, Time.local(2000, 1, 1, 1, 1, 1), 'a', 1).should == 'vorm.'
221
- @formatter.send(:period, Time.local(2000, 1, 1, 15, 1, 1), 'a', 1).should == 'nachm.'
220
+ expect(@formatter.send(:period, Time.local(2000, 1, 1, 1, 1, 1), 'a', 1)).to eq('vorm.')
221
+ expect(@formatter.send(:period, Time.local(2000, 1, 1, 15, 1, 1), 'a', 1)).to eq('nachm.')
222
222
  end
223
223
  end
224
224
 
225
225
  describe "#quarter" do
226
226
  it "test: pattern Q" do
227
- @formatter.send(:quarter, Date.new(2010, 1, 1), 'Q', 1).should == '1'
228
- @formatter.send(:quarter, Date.new(2010, 3, 31), 'Q', 1).should == '1'
229
- @formatter.send(:quarter, Date.new(2010, 4, 1), 'Q', 1).should == '2'
230
- @formatter.send(:quarter, Date.new(2010, 6, 30), 'Q', 1).should == '2'
231
- @formatter.send(:quarter, Date.new(2010, 7, 1), 'Q', 1).should == '3'
232
- @formatter.send(:quarter, Date.new(2010, 9, 30), 'Q', 1).should == '3'
233
- @formatter.send(:quarter, Date.new(2010, 10, 1), 'Q', 1).should == '4'
234
- @formatter.send(:quarter, Date.new(2010, 12, 31), 'Q', 1).should == '4'
227
+ expect(@formatter.send(:quarter, Date.new(2010, 1, 1), 'Q', 1)).to eq('1')
228
+ expect(@formatter.send(:quarter, Date.new(2010, 3, 31), 'Q', 1)).to eq('1')
229
+ expect(@formatter.send(:quarter, Date.new(2010, 4, 1), 'Q', 1)).to eq('2')
230
+ expect(@formatter.send(:quarter, Date.new(2010, 6, 30), 'Q', 1)).to eq('2')
231
+ expect(@formatter.send(:quarter, Date.new(2010, 7, 1), 'Q', 1)).to eq('3')
232
+ expect(@formatter.send(:quarter, Date.new(2010, 9, 30), 'Q', 1)).to eq('3')
233
+ expect(@formatter.send(:quarter, Date.new(2010, 10, 1), 'Q', 1)).to eq('4')
234
+ expect(@formatter.send(:quarter, Date.new(2010, 12, 31), 'Q', 1)).to eq('4')
235
235
  end
236
236
 
237
237
  it "test: pattern QQ" do
238
- @formatter.send(:quarter, Date.new(2010, 1, 1), 'QQ', 2).should == '01'
239
- @formatter.send(:quarter, Date.new(2010, 3, 31), 'QQ', 2).should == '01'
240
- @formatter.send(:quarter, Date.new(2010, 4, 1), 'QQ', 2).should == '02'
241
- @formatter.send(:quarter, Date.new(2010, 6, 30), 'QQ', 2).should == '02'
242
- @formatter.send(:quarter, Date.new(2010, 7, 1), 'QQ', 2).should == '03'
243
- @formatter.send(:quarter, Date.new(2010, 9, 30), 'QQ', 2).should == '03'
244
- @formatter.send(:quarter, Date.new(2010, 10, 1), 'QQ', 2).should == '04'
245
- @formatter.send(:quarter, Date.new(2010, 12, 31), 'QQ', 2).should == '04'
238
+ expect(@formatter.send(:quarter, Date.new(2010, 1, 1), 'QQ', 2)).to eq('01')
239
+ expect(@formatter.send(:quarter, Date.new(2010, 3, 31), 'QQ', 2)).to eq('01')
240
+ expect(@formatter.send(:quarter, Date.new(2010, 4, 1), 'QQ', 2)).to eq('02')
241
+ expect(@formatter.send(:quarter, Date.new(2010, 6, 30), 'QQ', 2)).to eq('02')
242
+ expect(@formatter.send(:quarter, Date.new(2010, 7, 1), 'QQ', 2)).to eq('03')
243
+ expect(@formatter.send(:quarter, Date.new(2010, 9, 30), 'QQ', 2)).to eq('03')
244
+ expect(@formatter.send(:quarter, Date.new(2010, 10, 1), 'QQ', 2)).to eq('04')
245
+ expect(@formatter.send(:quarter, Date.new(2010, 12, 31), 'QQ', 2)).to eq('04')
246
246
  end
247
247
 
248
248
  it "test: pattern QQQ" do
249
- @formatter.send(:quarter, Date.new(2010, 1, 1), 'QQQ', 3).should == 'Q1'
250
- @formatter.send(:quarter, Date.new(2010, 3, 31), 'QQQ', 3).should == 'Q1'
251
- @formatter.send(:quarter, Date.new(2010, 4, 1), 'QQQ', 3).should == 'Q2'
252
- @formatter.send(:quarter, Date.new(2010, 6, 30), 'QQQ', 3).should == 'Q2'
253
- @formatter.send(:quarter, Date.new(2010, 7, 1), 'QQQ', 3).should == 'Q3'
254
- @formatter.send(:quarter, Date.new(2010, 9, 30), 'QQQ', 3).should == 'Q3'
255
- @formatter.send(:quarter, Date.new(2010, 10, 1), 'QQQ', 3).should == 'Q4'
256
- @formatter.send(:quarter, Date.new(2010, 12, 31), 'QQQ', 3).should == 'Q4'
249
+ expect(@formatter.send(:quarter, Date.new(2010, 1, 1), 'QQQ', 3)).to eq('Q1')
250
+ expect(@formatter.send(:quarter, Date.new(2010, 3, 31), 'QQQ', 3)).to eq('Q1')
251
+ expect(@formatter.send(:quarter, Date.new(2010, 4, 1), 'QQQ', 3)).to eq('Q2')
252
+ expect(@formatter.send(:quarter, Date.new(2010, 6, 30), 'QQQ', 3)).to eq('Q2')
253
+ expect(@formatter.send(:quarter, Date.new(2010, 7, 1), 'QQQ', 3)).to eq('Q3')
254
+ expect(@formatter.send(:quarter, Date.new(2010, 9, 30), 'QQQ', 3)).to eq('Q3')
255
+ expect(@formatter.send(:quarter, Date.new(2010, 10, 1), 'QQQ', 3)).to eq('Q4')
256
+ expect(@formatter.send(:quarter, Date.new(2010, 12, 31), 'QQQ', 3)).to eq('Q4')
257
257
  end
258
258
 
259
259
  it "test: pattern QQQQ" do
260
- @formatter.send(:quarter, Date.new(2010, 1, 1), 'QQQQ', 4).should == '1. Quartal'
261
- @formatter.send(:quarter, Date.new(2010, 3, 31), 'QQQQ', 4).should == '1. Quartal'
262
- @formatter.send(:quarter, Date.new(2010, 4, 1), 'QQQQ', 4).should == '2. Quartal'
263
- @formatter.send(:quarter, Date.new(2010, 6, 30), 'QQQQ', 4).should == '2. Quartal'
264
- @formatter.send(:quarter, Date.new(2010, 7, 1), 'QQQQ', 4).should == '3. Quartal'
265
- @formatter.send(:quarter, Date.new(2010, 9, 30), 'QQQQ', 4).should == '3. Quartal'
266
- @formatter.send(:quarter, Date.new(2010, 10, 1), 'QQQQ', 4).should == '4. Quartal'
267
- @formatter.send(:quarter, Date.new(2010, 12, 31), 'QQQQ', 4).should == '4. Quartal'
260
+ expect(@formatter.send(:quarter, Date.new(2010, 1, 1), 'QQQQ', 4)).to eq('1. Quartal')
261
+ expect(@formatter.send(:quarter, Date.new(2010, 3, 31), 'QQQQ', 4)).to eq('1. Quartal')
262
+ expect(@formatter.send(:quarter, Date.new(2010, 4, 1), 'QQQQ', 4)).to eq('2. Quartal')
263
+ expect(@formatter.send(:quarter, Date.new(2010, 6, 30), 'QQQQ', 4)).to eq('2. Quartal')
264
+ expect(@formatter.send(:quarter, Date.new(2010, 7, 1), 'QQQQ', 4)).to eq('3. Quartal')
265
+ expect(@formatter.send(:quarter, Date.new(2010, 9, 30), 'QQQQ', 4)).to eq('3. Quartal')
266
+ expect(@formatter.send(:quarter, Date.new(2010, 10, 1), 'QQQQ', 4)).to eq('4. Quartal')
267
+ expect(@formatter.send(:quarter, Date.new(2010, 12, 31), 'QQQQ', 4)).to eq('4. Quartal')
268
268
  end
269
269
 
270
270
  it "test: pattern q" do
271
- @formatter.send(:quarter, Date.new(2010, 1, 1), 'q', 1).should == '1'
272
- @formatter.send(:quarter, Date.new(2010, 3, 31), 'q', 1).should == '1'
273
- @formatter.send(:quarter, Date.new(2010, 4, 1), 'q', 1).should == '2'
274
- @formatter.send(:quarter, Date.new(2010, 6, 30), 'q', 1).should == '2'
275
- @formatter.send(:quarter, Date.new(2010, 7, 1), 'q', 1).should == '3'
276
- @formatter.send(:quarter, Date.new(2010, 9, 30), 'q', 1).should == '3'
277
- @formatter.send(:quarter, Date.new(2010, 10, 1), 'q', 1).should == '4'
278
- @formatter.send(:quarter, Date.new(2010, 12, 31), 'q', 1).should == '4'
271
+ expect(@formatter.send(:quarter, Date.new(2010, 1, 1), 'q', 1)).to eq('1')
272
+ expect(@formatter.send(:quarter, Date.new(2010, 3, 31), 'q', 1)).to eq('1')
273
+ expect(@formatter.send(:quarter, Date.new(2010, 4, 1), 'q', 1)).to eq('2')
274
+ expect(@formatter.send(:quarter, Date.new(2010, 6, 30), 'q', 1)).to eq('2')
275
+ expect(@formatter.send(:quarter, Date.new(2010, 7, 1), 'q', 1)).to eq('3')
276
+ expect(@formatter.send(:quarter, Date.new(2010, 9, 30), 'q', 1)).to eq('3')
277
+ expect(@formatter.send(:quarter, Date.new(2010, 10, 1), 'q', 1)).to eq('4')
278
+ expect(@formatter.send(:quarter, Date.new(2010, 12, 31), 'q', 1)).to eq('4')
279
279
  end
280
280
 
281
281
  it "test: pattern qq" do
282
- @formatter.send(:quarter, Date.new(2010, 1, 1), 'qq', 2).should == '01'
283
- @formatter.send(:quarter, Date.new(2010, 3, 31), 'qq', 2).should == '01'
284
- @formatter.send(:quarter, Date.new(2010, 4, 1), 'qq', 2).should == '02'
285
- @formatter.send(:quarter, Date.new(2010, 6, 30), 'qq', 2).should == '02'
286
- @formatter.send(:quarter, Date.new(2010, 7, 1), 'qq', 2).should == '03'
287
- @formatter.send(:quarter, Date.new(2010, 9, 30), 'qq', 2).should == '03'
288
- @formatter.send(:quarter, Date.new(2010, 10, 1), 'qq', 2).should == '04'
289
- @formatter.send(:quarter, Date.new(2010, 12, 31), 'qq', 2).should == '04'
282
+ expect(@formatter.send(:quarter, Date.new(2010, 1, 1), 'qq', 2)).to eq('01')
283
+ expect(@formatter.send(:quarter, Date.new(2010, 3, 31), 'qq', 2)).to eq('01')
284
+ expect(@formatter.send(:quarter, Date.new(2010, 4, 1), 'qq', 2)).to eq('02')
285
+ expect(@formatter.send(:quarter, Date.new(2010, 6, 30), 'qq', 2)).to eq('02')
286
+ expect(@formatter.send(:quarter, Date.new(2010, 7, 1), 'qq', 2)).to eq('03')
287
+ expect(@formatter.send(:quarter, Date.new(2010, 9, 30), 'qq', 2)).to eq('03')
288
+ expect(@formatter.send(:quarter, Date.new(2010, 10, 1), 'qq', 2)).to eq('04')
289
+ expect(@formatter.send(:quarter, Date.new(2010, 12, 31), 'qq', 2)).to eq('04')
290
290
  end
291
291
  end
292
292
 
293
293
  describe "#second" do
294
294
  it "test: s" do
295
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 's', 1).should == '1'
296
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 11), 's', 1).should == '11'
295
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 's', 1)).to eq('1')
296
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 11), 's', 1)).to eq('11')
297
297
  end
298
298
 
299
299
  it "test: ss" do
300
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'ss', 2).should == '01'
301
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 11), 'ss', 2).should == '11'
300
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'ss', 2)).to eq('01')
301
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 11), 'ss', 2)).to eq('11')
302
302
  end
303
303
 
304
304
  # have i gotten the spec right here? (Sven Fuchs)
305
305
  it "test: S" do
306
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 0), 'S', 1).should == '0'
307
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'S', 1).should == '1'
308
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 18), 'S', 1).should == '18'
306
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 0), 'S', 1)).to eq('0')
307
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'S', 1)).to eq('1')
308
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 18), 'S', 1)).to eq('18')
309
309
  end
310
310
 
311
311
  it "test: SS" do
312
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 0), 'SS', 2).should == '00'
313
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'SS', 2).should == '01'
314
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 8), 'SS', 2).should == '08'
315
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 21), 'SS', 2).should == '21'
312
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 0), 'SS', 2)).to eq('00')
313
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'SS', 2)).to eq('01')
314
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 8), 'SS', 2)).to eq('08')
315
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 21), 'SS', 2)).to eq('21')
316
316
  end
317
317
 
318
318
  it "test: SSS" do
319
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 0), 'SSS', 3).should == '000'
320
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'SSS', 3).should == '001'
321
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 8), 'SSS', 3).should == '008'
322
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 21), 'SSS', 3).should == '021'
319
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 0), 'SSS', 3)).to eq('000')
320
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'SSS', 3)).to eq('001')
321
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 8), 'SSS', 3)).to eq('008')
322
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 21), 'SSS', 3)).to eq('021')
323
323
  end
324
324
 
325
325
  it "test: SSSS" do
326
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 0), 'SSSS', 4).should == '0000'
327
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'SSSS', 4).should == '0001'
328
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 8), 'SSSS', 4).should == '0008'
329
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 21), 'SSSS', 4).should == '0021'
326
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 0), 'SSSS', 4)).to eq('0000')
327
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'SSSS', 4)).to eq('0001')
328
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 8), 'SSSS', 4)).to eq('0008')
329
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 21), 'SSSS', 4)).to eq('0021')
330
330
  end
331
331
 
332
332
  it "test: SSSSS" do
333
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'SSSSS', 5).should == '00001'
334
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 8), 'SSSSS', 5).should == '00008'
335
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 21), 'SSSSS', 5).should == '00021'
333
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'SSSSS', 5)).to eq('00001')
334
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 8), 'SSSSS', 5)).to eq('00008')
335
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 21), 'SSSSS', 5)).to eq('00021')
336
336
  end
337
337
 
338
338
  it "test: SSSSSS" do
339
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'SSSSSS', 6).should == '000001'
340
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 8), 'SSSSSS', 6).should == '000008'
341
- @formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 21), 'SSSSSS', 6).should == '000021'
339
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 1), 'SSSSSS', 6)).to eq('000001')
340
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 8), 'SSSSSS', 6)).to eq('000008')
341
+ expect(@formatter.send(:second, Time.local(2000, 1, 1, 1, 1, 21), 'SSSSSS', 6)).to eq('000021')
342
342
  end
343
343
  end
344
344
 
345
345
  describe "#timezone" do
346
346
  it "test: z, zz, zzz" do # TODO is this what's meant by the spec?
347
- @formatter.send(:timezone, Time.gm(2000, 1, 1, 1, 1, 1), 'z', 1).should == 'UTC'
348
- @formatter.send(:timezone, Time.gm(2000, 1, 1, 1, 1, 1), 'zz', 2).should == 'UTC'
349
- @formatter.send(:timezone, Time.gm(2000, 1, 1, 1, 1, 1), 'zzz', 3).should == 'UTC'
350
- @formatter.send(:timezone, Time.gm(2000, 1, 1, 1, 1, 1), 'zzzz', 4).should =~ /^UTC (-|\+)\d{2}:\d{2}$/
347
+ expect(@formatter.send(:timezone, Time.gm(2000, 1, 1, 1, 1, 1), 'z', 1)).to eq('UTC')
348
+ expect(@formatter.send(:timezone, Time.gm(2000, 1, 1, 1, 1, 1), 'zz', 2)).to eq('UTC')
349
+ expect(@formatter.send(:timezone, Time.gm(2000, 1, 1, 1, 1, 1), 'zzz', 3)).to eq('UTC')
350
+ expect(@formatter.send(:timezone, Time.gm(2000, 1, 1, 1, 1, 1), 'zzzz', 4)).to match(/^UTC (-|\+)\d{2}:\d{2}$/)
351
351
  end
352
352
  end
353
353
 
354
354
  describe "#year" do
355
355
  it "test: pattern y" do
356
- @formatter.send(:year, Date.new( 5, 1, 1), 'y', 1).should == '5'
357
- @formatter.send(:year, Date.new( 45, 1, 1), 'y', 1).should == '45'
358
- @formatter.send(:year, Date.new( 345, 1, 1), 'y', 1).should == '345'
359
- @formatter.send(:year, Date.new( 2345, 1, 1), 'y', 1).should == '2345'
360
- @formatter.send(:year, Date.new(12345, 1, 1), 'y', 1).should == '12345'
356
+ expect(@formatter.send(:year, Date.new( 5, 1, 1), 'y', 1)).to eq('5')
357
+ expect(@formatter.send(:year, Date.new( 45, 1, 1), 'y', 1)).to eq('45')
358
+ expect(@formatter.send(:year, Date.new( 345, 1, 1), 'y', 1)).to eq('345')
359
+ expect(@formatter.send(:year, Date.new( 2345, 1, 1), 'y', 1)).to eq('2345')
360
+ expect(@formatter.send(:year, Date.new(12345, 1, 1), 'y', 1)).to eq('12345')
361
361
  end
362
362
 
363
363
  it "test: pattern yy" do
364
- @formatter.send(:year, Date.new( 5, 1, 1), 'yy', 2).should == '05'
365
- @formatter.send(:year, Date.new( 45, 1, 1), 'yy', 2).should == '45'
366
- @formatter.send(:year, Date.new( 345, 1, 1), 'yy', 2).should == '45'
367
- @formatter.send(:year, Date.new( 2345, 1, 1), 'yy', 2).should == '45'
368
- @formatter.send(:year, Date.new(12345, 1, 1), 'yy', 2).should == '45'
364
+ expect(@formatter.send(:year, Date.new( 5, 1, 1), 'yy', 2)).to eq('05')
365
+ expect(@formatter.send(:year, Date.new( 45, 1, 1), 'yy', 2)).to eq('45')
366
+ expect(@formatter.send(:year, Date.new( 345, 1, 1), 'yy', 2)).to eq('45')
367
+ expect(@formatter.send(:year, Date.new( 2345, 1, 1), 'yy', 2)).to eq('45')
368
+ expect(@formatter.send(:year, Date.new(12345, 1, 1), 'yy', 2)).to eq('45')
369
369
  end
370
370
 
371
371
  it "test: pattern yyy" do
372
- @formatter.send(:year, Date.new( 5, 1, 1), 'yyy', 3).should == '005'
373
- @formatter.send(:year, Date.new( 45, 1, 1), 'yyy', 3).should == '045'
374
- @formatter.send(:year, Date.new( 345, 1, 1), 'yyy', 3).should == '345'
375
- @formatter.send(:year, Date.new( 2345, 1, 1), 'yyy', 3).should == '2345'
376
- @formatter.send(:year, Date.new(12345, 1, 1), 'yyy', 3).should == '12345'
372
+ expect(@formatter.send(:year, Date.new( 5, 1, 1), 'yyy', 3)).to eq('005')
373
+ expect(@formatter.send(:year, Date.new( 45, 1, 1), 'yyy', 3)).to eq('045')
374
+ expect(@formatter.send(:year, Date.new( 345, 1, 1), 'yyy', 3)).to eq('345')
375
+ expect(@formatter.send(:year, Date.new( 2345, 1, 1), 'yyy', 3)).to eq('2345')
376
+ expect(@formatter.send(:year, Date.new(12345, 1, 1), 'yyy', 3)).to eq('12345')
377
377
  end
378
378
 
379
379
  it "test: pattern yyyy" do
380
- @formatter.send(:year, Date.new( 5, 1, 1), 'yyyy', 4).should == '0005'
381
- @formatter.send(:year, Date.new( 45, 1, 1), 'yyyy', 4).should == '0045'
382
- @formatter.send(:year, Date.new( 345, 1, 1), 'yyyy', 4).should == '0345'
383
- @formatter.send(:year, Date.new( 2345, 1, 1), 'yyyy', 4).should == '2345'
384
- @formatter.send(:year, Date.new(12345, 1, 1), 'yyyy', 4).should == '12345'
380
+ expect(@formatter.send(:year, Date.new( 5, 1, 1), 'yyyy', 4)).to eq('0005')
381
+ expect(@formatter.send(:year, Date.new( 45, 1, 1), 'yyyy', 4)).to eq('0045')
382
+ expect(@formatter.send(:year, Date.new( 345, 1, 1), 'yyyy', 4)).to eq('0345')
383
+ expect(@formatter.send(:year, Date.new( 2345, 1, 1), 'yyyy', 4)).to eq('2345')
384
+ expect(@formatter.send(:year, Date.new(12345, 1, 1), 'yyyy', 4)).to eq('12345')
385
385
  end
386
386
 
387
387
  it "test: pattern yyyyy" do
388
- @formatter.send(:year, Date.new( 5, 1, 1), 'yyyyy', 5).should == '00005'
389
- @formatter.send(:year, Date.new( 45, 1, 1), 'yyyyy', 5).should == '00045'
390
- @formatter.send(:year, Date.new( 345, 1, 1), 'yyyyy', 5).should == '00345'
391
- @formatter.send(:year, Date.new( 2345, 1, 1), 'yyyyy', 5).should == '02345'
392
- @formatter.send(:year, Date.new(12345, 1, 1), 'yyyyy', 5).should == '12345'
388
+ expect(@formatter.send(:year, Date.new( 5, 1, 1), 'yyyyy', 5)).to eq('00005')
389
+ expect(@formatter.send(:year, Date.new( 45, 1, 1), 'yyyyy', 5)).to eq('00045')
390
+ expect(@formatter.send(:year, Date.new( 345, 1, 1), 'yyyyy', 5)).to eq('00345')
391
+ expect(@formatter.send(:year, Date.new( 2345, 1, 1), 'yyyyy', 5)).to eq('02345')
392
+ expect(@formatter.send(:year, Date.new(12345, 1, 1), 'yyyyy', 5)).to eq('12345')
393
393
  end
394
394
  end
395
395
 
@@ -400,23 +400,23 @@ describe DateTimeFormatter do
400
400
  end
401
401
 
402
402
  it "test: pattern G" do
403
- @formatter.send(:era, Date.new(2012, 1, 1), 'G', 1).should == "CE"
404
- @formatter.send(:era, Date.new(-1, 1, 1), 'G', 1).should == "BCE"
403
+ expect(@formatter.send(:era, Date.new(2012, 1, 1), 'G', 1)).to eq("CE")
404
+ expect(@formatter.send(:era, Date.new(-1, 1, 1), 'G', 1)).to eq("BCE")
405
405
  end
406
406
 
407
407
  it "test: pattern GG" do
408
- @formatter.send(:era, Date.new(2012, 1, 1), 'GG', 2).should == "CE"
409
- @formatter.send(:era, Date.new(-1, 1, 1), 'GG', 2).should == "BCE"
408
+ expect(@formatter.send(:era, Date.new(2012, 1, 1), 'GG', 2)).to eq("CE")
409
+ expect(@formatter.send(:era, Date.new(-1, 1, 1), 'GG', 2)).to eq("BCE")
410
410
  end
411
411
 
412
412
  it "test: pattern GGG" do
413
- @formatter.send(:era, Date.new(2012, 1, 1), 'GGG', 3).should == "CE"
414
- @formatter.send(:era, Date.new(-1, 1, 1), 'GGG', 3).should == "BCE"
413
+ expect(@formatter.send(:era, Date.new(2012, 1, 1), 'GGG', 3)).to eq("CE")
414
+ expect(@formatter.send(:era, Date.new(-1, 1, 1), 'GGG', 3)).to eq("BCE")
415
415
  end
416
416
 
417
417
  it "test: pattern GGGG" do
418
- @formatter.send(:era, Date.new(2012, 1, 1), 'GGGG', 4).should == "Common Era"
419
- @formatter.send(:era, Date.new(-1, 1, 1), 'GGGG', 4).should == "Before Common Era"
418
+ expect(@formatter.send(:era, Date.new(2012, 1, 1), 'GGGG', 4)).to eq("Common Era")
419
+ expect(@formatter.send(:era, Date.new(-1, 1, 1), 'GGGG', 4)).to eq("Before Common Era")
420
420
  end
421
421
 
422
422
  it "should fall back if the calendar doesn't contain the appropriate era data" do
@@ -431,34 +431,34 @@ describe DateTimeFormatter do
431
431
  date = Date.new(2012, 1, 1)
432
432
  mock.proxy(@formatter).era(date, "GGGG", 4) # first attempts to find full name era
433
433
  mock.proxy(@formatter).era(date, "GGG", 3) # falls back to abbreviated era
434
- @formatter.send(:era, date, 'GGGG', 4).should == "abbr1"
434
+ expect(@formatter.send(:era, date, 'GGGG', 4)).to eq("abbr1")
435
435
  end
436
436
  end
437
437
 
438
438
  describe "#month_stand_alone" do
439
439
  it "pattern L" do
440
- @formatter.send(:month_stand_alone, Date.new(2010, 1, 1), 'L', 1).should == "1"
441
- @formatter.send(:month_stand_alone, Date.new(2010, 10, 1), 'L', 1).should == "10"
440
+ expect(@formatter.send(:month_stand_alone, Date.new(2010, 1, 1), 'L', 1)).to eq("1")
441
+ expect(@formatter.send(:month_stand_alone, Date.new(2010, 10, 1), 'L', 1)).to eq("10")
442
442
  end
443
443
 
444
444
  it "pattern LL" do
445
- @formatter.send(:month_stand_alone, Date.new(2010, 1, 1), 'LL', 2).should == "01"
446
- @formatter.send(:month_stand_alone, Date.new(2010, 10, 1), 'LL', 2).should == "10"
445
+ expect(@formatter.send(:month_stand_alone, Date.new(2010, 1, 1), 'LL', 2)).to eq("01")
446
+ expect(@formatter.send(:month_stand_alone, Date.new(2010, 10, 1), 'LL', 2)).to eq("10")
447
447
  end
448
448
 
449
449
  it "pattern LLL" do
450
- @formatter.send(:month_stand_alone, Date.new(2010, 1, 1), 'LLL', 3).should == "Jan"
451
- @formatter.send(:month_stand_alone, Date.new(2010, 10, 1), 'LLL', 3).should == "Okt"
450
+ expect(@formatter.send(:month_stand_alone, Date.new(2010, 1, 1), 'LLL', 3)).to eq("Jan")
451
+ expect(@formatter.send(:month_stand_alone, Date.new(2010, 10, 1), 'LLL', 3)).to eq("Okt")
452
452
  end
453
453
 
454
454
  it "pattern LLLL" do
455
- @formatter.send(:month_stand_alone, Date.new(2010, 1, 1), 'LLLL', 4).should == "Januar"
456
- @formatter.send(:month_stand_alone, Date.new(2010, 10, 1), 'LLLL', 4).should == "Oktober"
455
+ expect(@formatter.send(:month_stand_alone, Date.new(2010, 1, 1), 'LLLL', 4)).to eq("Januar")
456
+ expect(@formatter.send(:month_stand_alone, Date.new(2010, 10, 1), 'LLLL', 4)).to eq("Oktober")
457
457
  end
458
458
 
459
459
  it "pattern LLLLL" do
460
- @formatter.send(:month_stand_alone, Date.new(2010, 1, 1), 'LLLLL', 5).should == "J"
461
- @formatter.send(:month_stand_alone, Date.new(2010, 10, 1), 'LLLLL', 5).should == "O"
460
+ expect(@formatter.send(:month_stand_alone, Date.new(2010, 1, 1), 'LLLLL', 5)).to eq("J")
461
+ expect(@formatter.send(:month_stand_alone, Date.new(2010, 10, 1), 'LLLLL', 5)).to eq("O")
462
462
  end
463
463
  end
464
464
  end