lazier 3.2.5 → 3.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +1 -1
- data/doc/Lazier.html +1 -1
- data/doc/Lazier/Boolean.html +1 -1
- data/doc/Lazier/Configuration.html +1 -1
- data/doc/Lazier/DateTime.html +1 -1
- data/doc/Lazier/DateTime/ClassMethods.html +1 -1
- data/doc/Lazier/Exceptions.html +1 -1
- data/doc/Lazier/Exceptions/Debug.html +1 -1
- data/doc/Lazier/Exceptions/MissingTranslation.html +1 -1
- data/doc/Lazier/Hash.html +1 -1
- data/doc/Lazier/I18n.html +1 -1
- data/doc/Lazier/Localizer.html +1 -1
- data/doc/Lazier/Math.html +1 -1
- data/doc/Lazier/Math/ClassMethods.html +1 -1
- data/doc/Lazier/Object.html +1 -1
- data/doc/Lazier/Pathname.html +1 -1
- data/doc/Lazier/Settings.html +1 -1
- data/doc/Lazier/String.html +1 -1
- data/doc/Lazier/TimeZone.html +1 -1
- data/doc/Lazier/TimeZone/ClassMethods.html +1 -1
- data/doc/Lazier/Version.html +2 -2
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/top-level-namespace.html +1 -1
- data/lib/lazier/version.rb +1 -1
- data/spec/lazier/datetime_spec.rb +6 -6
- data/spec/lazier/i18n_spec.rb +15 -14
- data/spec/lazier/localizer_spec.rb +13 -11
- data/spec/lazier/math_spec.rb +2 -2
- data/spec/lazier/settings_spec.rb +2 -2
- data/spec/lazier_spec.rb +2 -4
- metadata +3 -3
data/.travis.yml
CHANGED
data/doc/Lazier.html
CHANGED
|
@@ -969,7 +969,7 @@ Licensed under the MIT license, which can be found at http://www.opensource.org/
|
|
|
969
969
|
</div>
|
|
970
970
|
|
|
971
971
|
<div id="footer">
|
|
972
|
-
Generated on
|
|
972
|
+
Generated on Sat Jul 20 10:18:17 2013 by
|
|
973
973
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
974
974
|
0.8.6.2 (ruby-1.9.3).
|
|
975
975
|
</div>
|
data/doc/Lazier/Boolean.html
CHANGED
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
</div>
|
|
289
289
|
|
|
290
290
|
<div id="footer">
|
|
291
|
-
Generated on
|
|
291
|
+
Generated on Sat Jul 20 10:18:18 2013 by
|
|
292
292
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
293
293
|
0.8.6.2 (ruby-1.9.3).
|
|
294
294
|
</div>
|
|
@@ -386,7 +386,7 @@ Options are as follows:</p>
|
|
|
386
386
|
</div>
|
|
387
387
|
|
|
388
388
|
<div id="footer">
|
|
389
|
-
Generated on
|
|
389
|
+
Generated on Sat Jul 20 10:18:19 2013 by
|
|
390
390
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
391
391
|
0.8.6.2 (ruby-1.9.3).
|
|
392
392
|
</div>
|
data/doc/Lazier/DateTime.html
CHANGED
|
@@ -721,7 +721,7 @@ DateTime.civil(2013, 6, 1).in_months(2011)
|
|
|
721
721
|
</div>
|
|
722
722
|
|
|
723
723
|
<div id="footer">
|
|
724
|
-
Generated on
|
|
724
|
+
Generated on Sat Jul 20 10:18:18 2013 by
|
|
725
725
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
726
726
|
0.8.6.2 (ruby-1.9.3).
|
|
727
727
|
</div>
|
|
@@ -1542,7 +1542,7 @@ Date.years(1, true, 2010, true)
|
|
|
1542
1542
|
</div>
|
|
1543
1543
|
|
|
1544
1544
|
<div id="footer">
|
|
1545
|
-
Generated on
|
|
1545
|
+
Generated on Sat Jul 20 10:18:18 2013 by
|
|
1546
1546
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1547
1547
|
0.8.6.2 (ruby-1.9.3).
|
|
1548
1548
|
</div>
|
data/doc/Lazier/Exceptions.html
CHANGED
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div id="footer">
|
|
119
|
-
Generated on
|
|
119
|
+
Generated on Sat Jul 20 10:18:19 2013 by
|
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
121
121
|
0.8.6.2 (ruby-1.9.3).
|
|
122
122
|
</div>
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
</div>
|
|
125
125
|
|
|
126
126
|
<div id="footer">
|
|
127
|
-
Generated on
|
|
127
|
+
Generated on Sat Jul 20 10:18:19 2013 by
|
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
129
129
|
0.8.6.2 (ruby-1.9.3).
|
|
130
130
|
</div>
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
</div>
|
|
239
239
|
|
|
240
240
|
<div id="footer">
|
|
241
|
-
Generated on
|
|
241
|
+
Generated on Sat Jul 20 10:18:19 2013 by
|
|
242
242
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
243
243
|
0.8.6.2 (ruby-1.9.3).
|
|
244
244
|
</div>
|
data/doc/Lazier/Hash.html
CHANGED
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
</div>
|
|
112
112
|
|
|
113
113
|
<div id="footer">
|
|
114
|
-
Generated on
|
|
114
|
+
Generated on Sat Jul 20 10:18:17 2013 by
|
|
115
115
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
116
116
|
0.8.6.2 (ruby-1.9.3).
|
|
117
117
|
</div>
|
data/doc/Lazier/I18n.html
CHANGED
|
@@ -1056,7 +1056,7 @@
|
|
|
1056
1056
|
</div>
|
|
1057
1057
|
|
|
1058
1058
|
<div id="footer">
|
|
1059
|
-
Generated on
|
|
1059
|
+
Generated on Sat Jul 20 10:18:18 2013 by
|
|
1060
1060
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1061
1061
|
0.8.6.2 (ruby-1.9.3).
|
|
1062
1062
|
</div>
|
data/doc/Lazier/Localizer.html
CHANGED
|
@@ -536,7 +536,7 @@
|
|
|
536
536
|
</div>
|
|
537
537
|
|
|
538
538
|
<div id="footer">
|
|
539
|
-
Generated on
|
|
539
|
+
Generated on Sat Jul 20 10:18:19 2013 by
|
|
540
540
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
541
541
|
0.8.6.2 (ruby-1.9.3).
|
|
542
542
|
</div>
|
data/doc/Lazier/Math.html
CHANGED
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
</div>
|
|
122
122
|
|
|
123
123
|
<div id="footer">
|
|
124
|
-
Generated on
|
|
124
|
+
Generated on Sat Jul 20 10:18:18 2013 by
|
|
125
125
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
126
126
|
0.8.6.2 (ruby-1.9.3).
|
|
127
127
|
</div>
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
</div>
|
|
322
322
|
|
|
323
323
|
<div id="footer">
|
|
324
|
-
Generated on
|
|
324
|
+
Generated on Sat Jul 20 10:18:18 2013 by
|
|
325
325
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
326
326
|
0.8.6.2 (ruby-1.9.3).
|
|
327
327
|
</div>
|
data/doc/Lazier/Object.html
CHANGED
|
@@ -2039,7 +2039,7 @@
|
|
|
2039
2039
|
</div>
|
|
2040
2040
|
|
|
2041
2041
|
<div id="footer">
|
|
2042
|
-
Generated on
|
|
2042
|
+
Generated on Sat Jul 20 10:18:18 2013 by
|
|
2043
2043
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
2044
2044
|
0.8.6.2 (ruby-1.9.3).
|
|
2045
2045
|
</div>
|
data/doc/Lazier/Pathname.html
CHANGED
|
@@ -213,7 +213,7 @@ Pathname.new("/usr/bin/ruby").components
|
|
|
213
213
|
</div>
|
|
214
214
|
|
|
215
215
|
<div id="footer">
|
|
216
|
-
Generated on
|
|
216
|
+
Generated on Sat Jul 20 10:18:19 2013 by
|
|
217
217
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
218
218
|
0.8.6.2 (ruby-1.9.3).
|
|
219
219
|
</div>
|
data/doc/Lazier/Settings.html
CHANGED
|
@@ -2405,7 +2405,7 @@
|
|
|
2405
2405
|
</div>
|
|
2406
2406
|
|
|
2407
2407
|
<div id="footer">
|
|
2408
|
-
Generated on
|
|
2408
|
+
Generated on Sat Jul 20 10:18:19 2013 by
|
|
2409
2409
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
2410
2410
|
0.8.6.2 (ruby-1.9.3).
|
|
2411
2411
|
</div>
|
data/doc/Lazier/String.html
CHANGED
|
@@ -563,7 +563,7 @@
|
|
|
563
563
|
</div>
|
|
564
564
|
|
|
565
565
|
<div id="footer">
|
|
566
|
-
Generated on
|
|
566
|
+
Generated on Sat Jul 20 10:18:18 2013 by
|
|
567
567
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
568
568
|
0.8.6.2 (ruby-1.9.3).
|
|
569
569
|
</div>
|
data/doc/Lazier/TimeZone.html
CHANGED
|
@@ -1663,7 +1663,7 @@
|
|
|
1663
1663
|
</div>
|
|
1664
1664
|
|
|
1665
1665
|
<div id="footer">
|
|
1666
|
-
Generated on
|
|
1666
|
+
Generated on Sat Jul 20 10:18:19 2013 by
|
|
1667
1667
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1668
1668
|
0.8.6.2 (ruby-1.9.3).
|
|
1669
1669
|
</div>
|
|
@@ -1015,7 +1015,7 @@ DateTime.parameterize_zone(ActiveSupport::TimeZone["Pacific Time (US & Canad
|
|
|
1015
1015
|
</div>
|
|
1016
1016
|
|
|
1017
1017
|
<div id="footer">
|
|
1018
|
-
Generated on
|
|
1018
|
+
Generated on Sat Jul 20 10:18:19 2013 by
|
|
1019
1019
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1020
1020
|
0.8.6.2 (ruby-1.9.3).
|
|
1021
1021
|
</div>
|
data/doc/Lazier/Version.html
CHANGED
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
|
|
150
150
|
</div>
|
|
151
151
|
</dt>
|
|
152
|
-
<dd><pre class="code"><span class='int'>
|
|
152
|
+
<dd><pre class="code"><span class='int'>6</span></pre></dd>
|
|
153
153
|
|
|
154
154
|
<dt id="STRING-constant" class="">STRING =
|
|
155
155
|
<div class="docstring">
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
</div>
|
|
181
181
|
|
|
182
182
|
<div id="footer">
|
|
183
|
-
Generated on
|
|
183
|
+
Generated on Sat Jul 20 10:18:18 2013 by
|
|
184
184
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
185
185
|
0.8.6.2 (ruby-1.9.3).
|
|
186
186
|
</div>
|
data/doc/_index.html
CHANGED
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
</div>
|
|
334
334
|
|
|
335
335
|
<div id="footer">
|
|
336
|
-
Generated on
|
|
336
|
+
Generated on Sat Jul 20 10:18:17 2013 by
|
|
337
337
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
338
338
|
0.8.6.2 (ruby-1.9.3).
|
|
339
339
|
</div>
|
data/doc/file.README.html
CHANGED
|
@@ -105,7 +105,7 @@ See documentation for more informations.</p>
|
|
|
105
105
|
</div></div>
|
|
106
106
|
|
|
107
107
|
<div id="footer">
|
|
108
|
-
Generated on
|
|
108
|
+
Generated on Sat Jul 20 10:18:17 2013 by
|
|
109
109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
110
110
|
0.8.6.2 (ruby-1.9.3).
|
|
111
111
|
</div>
|
data/doc/index.html
CHANGED
|
@@ -105,7 +105,7 @@ See documentation for more informations.</p>
|
|
|
105
105
|
</div></div>
|
|
106
106
|
|
|
107
107
|
<div id="footer">
|
|
108
|
-
Generated on
|
|
108
|
+
Generated on Sat Jul 20 10:18:17 2013 by
|
|
109
109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
110
110
|
0.8.6.2 (ruby-1.9.3).
|
|
111
111
|
</div>
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
</div>
|
|
104
104
|
|
|
105
105
|
<div id="footer">
|
|
106
|
-
Generated on
|
|
106
|
+
Generated on Sat Jul 20 10:18:17 2013 by
|
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
108
108
|
0.8.6.2 (ruby-1.9.3).
|
|
109
109
|
</div>
|
data/lib/lazier/version.rb
CHANGED
|
@@ -65,35 +65,35 @@ describe Lazier::DateTime do
|
|
|
65
65
|
|
|
66
66
|
describe ".list_timezones" do
|
|
67
67
|
it "should forward to ActiveSupport::TimeZone" do
|
|
68
|
-
::ActiveSupport::TimeZone.
|
|
68
|
+
expect(::ActiveSupport::TimeZone).to receive(:list_all)
|
|
69
69
|
::DateTime.list_timezones
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
describe ".find_timezone" do
|
|
74
74
|
it "should forward to ActiveSupport::TimeZone" do
|
|
75
|
-
::ActiveSupport::TimeZone.
|
|
75
|
+
expect(::ActiveSupport::TimeZone).to receive(:find)
|
|
76
76
|
::DateTime.find_timezone(reference_zone.name)
|
|
77
77
|
end
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
describe ".rationalize_offset" do
|
|
81
81
|
it "should return the correct rational value" do
|
|
82
|
-
::ActiveSupport::TimeZone.
|
|
82
|
+
expect(::ActiveSupport::TimeZone).to receive(:rationalize_offset)
|
|
83
83
|
::DateTime.rationalize_offset(0)
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
86
|
|
|
87
87
|
describe ".parameterize_zone" do
|
|
88
88
|
it "should forward to ActiveSupport::TimeZone" do
|
|
89
|
-
::ActiveSupport::TimeZone.
|
|
89
|
+
expect(::ActiveSupport::TimeZone).to receive(:parameterize_zone)
|
|
90
90
|
::DateTime.parameterize_zone(reference_zone)
|
|
91
91
|
end
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
describe ".unparameterize_zone" do
|
|
95
95
|
it "should forward to ActiveSupport::TimeZone" do
|
|
96
|
-
::ActiveSupport::TimeZone.
|
|
96
|
+
expect(::ActiveSupport::TimeZone).to receive(:unparameterize_zone)
|
|
97
97
|
::DateTime.unparameterize_zone(reference_zone)
|
|
98
98
|
end
|
|
99
99
|
end
|
|
@@ -276,7 +276,7 @@ describe Lazier::TimeZone do
|
|
|
276
276
|
it "should correctly return current zone alias or the first one" do
|
|
277
277
|
zone = ActiveSupport::TimeZone["America/Halifax"]
|
|
278
278
|
expect(zone.current_alias).to eq("America/Halifax")
|
|
279
|
-
zone.tzinfo.
|
|
279
|
+
allow(zone.tzinfo).to receive(:identifier).and_return("INVALID")
|
|
280
280
|
expect(zone.current_alias).to eq("America/Atlantic Time (Canada)")
|
|
281
281
|
end
|
|
282
282
|
end
|
data/spec/lazier/i18n_spec.rb
CHANGED
|
@@ -6,17 +6,18 @@
|
|
|
6
6
|
|
|
7
7
|
require "spec_helper"
|
|
8
8
|
|
|
9
|
-
class Container
|
|
10
|
-
include Lazier::I18n
|
|
11
|
-
end
|
|
12
|
-
|
|
13
9
|
describe Lazier::I18n do
|
|
14
|
-
let(:object) {
|
|
10
|
+
let(:object) {
|
|
11
|
+
c = Object.new
|
|
12
|
+
c.class_eval { include Lazier::I18n }
|
|
13
|
+
c
|
|
14
|
+
}
|
|
15
|
+
|
|
15
16
|
let(:root_path) { ::File.absolute_path(::Pathname.new(::File.dirname(__FILE__)).to_s + "/../../locales/") }
|
|
16
17
|
|
|
17
18
|
before(:each) do
|
|
18
19
|
ENV["LANG"] = "en"
|
|
19
|
-
::R18n::I18n.
|
|
20
|
+
allow(::R18n::I18n).to receive(:system_locale).and_return("en")
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
describe "#i18n_setup" do
|
|
@@ -30,14 +31,14 @@ describe Lazier::I18n do
|
|
|
30
31
|
describe "#i18n" do
|
|
31
32
|
it "should call the private method if nothing is set" do
|
|
32
33
|
object.instance_variable_set(:@i18n, nil)
|
|
33
|
-
object.
|
|
34
|
+
expect(object).to receive(:i18n_load_locale)
|
|
34
35
|
object.i18n
|
|
35
36
|
end
|
|
36
37
|
end
|
|
37
38
|
|
|
38
39
|
describe "#i18n=" do
|
|
39
40
|
it "should call the private method if nothing is set" do
|
|
40
|
-
object.
|
|
41
|
+
expect(object).to receive(:i18n_load_locale).and_return("LOCALE")
|
|
41
42
|
object.i18n = :en
|
|
42
43
|
expect(object.instance_variable_get(:@i18n)).to eq("LOCALE")
|
|
43
44
|
end
|
|
@@ -46,34 +47,34 @@ describe Lazier::I18n do
|
|
|
46
47
|
describe "#i18n_load_locale" do
|
|
47
48
|
it "should set using system locale if called without arguments" do
|
|
48
49
|
object.i18n_setup("lazier", root_path)
|
|
49
|
-
::R18n::I18n.
|
|
50
|
+
expect(::R18n::I18n).to receive(:new).with([ENV["LANG"]].compact.uniq, root_path).and_call_original
|
|
50
51
|
object.i18n = nil
|
|
51
52
|
end
|
|
52
53
|
|
|
53
54
|
it "should set the requested locale" do
|
|
54
55
|
object.i18n_setup("lazier", root_path)
|
|
55
|
-
::R18n::I18n.
|
|
56
|
+
expect(::R18n::I18n).to receive(:new).with(["it", ENV["LANG"]].compact.uniq, root_path).and_call_original
|
|
56
57
|
object.i18n = :it
|
|
57
58
|
end
|
|
58
59
|
|
|
59
60
|
it "should call the root" do
|
|
60
61
|
Lazier.load!
|
|
61
62
|
t = ::Object.new
|
|
63
|
+
expect_any_instance_of(::R18n::I18n).to receive(:t).and_return(t)
|
|
64
|
+
expect(t).to receive("ROOT")
|
|
62
65
|
object.i18n_setup("ROOT", root_path)
|
|
63
|
-
::R18n::I18n.any_instance.should_receive(:t).and_return(t)
|
|
64
|
-
t.should_receive("ROOT")
|
|
65
66
|
object.i18n = :it
|
|
66
67
|
end
|
|
67
68
|
|
|
68
69
|
it "should only pass valid translations" do
|
|
69
70
|
object.i18n_setup("lazier", root_path)
|
|
70
|
-
::R18n::I18n.
|
|
71
|
+
expect(::R18n::I18n).to receive(:new).with([ENV["LANG"]].compact.uniq, root_path).and_call_original
|
|
71
72
|
object.i18n = "INVALID"
|
|
72
73
|
end
|
|
73
74
|
|
|
74
75
|
it "should raise an exception if no valid translation are found" do
|
|
75
76
|
ENV["LANG"] = "INVALID"
|
|
76
|
-
::R18n::I18n.
|
|
77
|
+
allow(::R18n::I18n).to receive(:system_locale).and_return("INVALID")
|
|
77
78
|
object.i18n_setup("ROOT", "/dev/")
|
|
78
79
|
expect { object.i18n = "INVALID" }.to raise_error(::Lazier::Exceptions::MissingTranslation)
|
|
79
80
|
end
|
|
@@ -9,14 +9,14 @@ require "spec_helper"
|
|
|
9
9
|
describe Lazier::Localizer do
|
|
10
10
|
describe "#initialize" do
|
|
11
11
|
it "should call i18n_setup and then i18n=" do
|
|
12
|
-
::Lazier::Localizer.
|
|
13
|
-
::Lazier::Localizer.
|
|
12
|
+
expect_any_instance_of(::Lazier::Localizer).to receive(:i18n_setup).with("ROOT", "PATH")
|
|
13
|
+
expect_any_instance_of(::Lazier::Localizer).to receive(:i18n=).with(:it)
|
|
14
14
|
::Lazier::Localizer.new("ROOT", "PATH", :it)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
it "should setup default arguments" do
|
|
18
|
-
::Lazier::Localizer.
|
|
19
|
-
::Lazier::Localizer.
|
|
18
|
+
expect_any_instance_of(::Lazier::Localizer).to receive(:i18n_setup).with(:lazier, ::File.absolute_path(::Pathname.new(::File.dirname(__FILE__)).to_s + "/../../locales/"))
|
|
19
|
+
expect_any_instance_of(::Lazier::Localizer).to receive(:i18n=).with(nil)
|
|
20
20
|
::Lazier::Localizer.new
|
|
21
21
|
end
|
|
22
22
|
end
|
|
@@ -24,19 +24,21 @@ describe Lazier::Localizer do
|
|
|
24
24
|
describe ".localize" do
|
|
25
25
|
it "should create a new localizer and forward the message" do
|
|
26
26
|
obj = ::Object.new
|
|
27
|
-
obj.
|
|
28
|
-
|
|
29
|
-
::Lazier::Localizer.
|
|
30
|
-
::Lazier::Localizer.
|
|
27
|
+
expect(obj).to receive(:string).with("ARGUMENT")
|
|
28
|
+
|
|
29
|
+
expect(::Lazier::Localizer).to receive(:new).and_call_original
|
|
30
|
+
expect_any_instance_of(::Lazier::Localizer).to receive(:i18n).and_return(obj)
|
|
31
|
+
::Lazier::Localizer.localize_on_locale(:it, :string, "ARGUMENT")
|
|
31
32
|
end
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
describe ".localize" do
|
|
35
36
|
it "should create a new localizer and forward the message" do
|
|
36
37
|
obj = ::Object.new
|
|
37
|
-
obj.
|
|
38
|
-
|
|
39
|
-
::Lazier::Localizer.
|
|
38
|
+
expect(obj).to receive(:string).with("ARGUMENT")
|
|
39
|
+
|
|
40
|
+
expect(::Lazier::Localizer).to receive(:new).with(nil, nil, :it).and_call_original
|
|
41
|
+
expect_any_instance_of(::Lazier::Localizer).to receive(:i18n).and_return(obj)
|
|
40
42
|
::Lazier::Localizer.localize_on_locale(:it, :string, "ARGUMENT")
|
|
41
43
|
end
|
|
42
44
|
end
|
data/spec/lazier/math_spec.rb
CHANGED
|
@@ -23,7 +23,7 @@ describe Lazier::Math do
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
it "should return nil for an empty array" do
|
|
26
|
-
expect(::Math.min
|
|
26
|
+
expect(::Math.min).to be_nil
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -35,7 +35,7 @@ describe Lazier::Math do
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
it "should return nil for an empty array" do
|
|
38
|
-
expect(::Math.max
|
|
38
|
+
expect(::Math.max).to be_nil
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
end
|
|
@@ -23,7 +23,7 @@ describe Lazier::Settings do
|
|
|
23
23
|
|
|
24
24
|
it "should always return the same instance" do
|
|
25
25
|
instance = ::Lazier::Settings.instance
|
|
26
|
-
::Lazier::Settings.
|
|
26
|
+
expect(::Lazier::Settings).not_to receive(:new)
|
|
27
27
|
expect(::Lazier::Settings.instance).to eq(instance)
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -90,7 +90,7 @@ describe Lazier::Settings do
|
|
|
90
90
|
expect(date_reference.lstrftime("ct_date")).to eq("ct_date")
|
|
91
91
|
expect(date_reference.lstrftime(:c1)).to eq(date_reference.year.to_s)
|
|
92
92
|
|
|
93
|
-
reference.setup_date_formats
|
|
93
|
+
reference.setup_date_formats
|
|
94
94
|
expect(date_reference.lstrftime(:ct_date)).to eq(date_reference.strftime("%Y-%m-%d"))
|
|
95
95
|
expect(date_reference.lstrftime("c1")).to eq(date_reference.year.to_s)
|
|
96
96
|
|
data/spec/lazier_spec.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lazier
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.2.
|
|
4
|
+
version: 3.2.6
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-07-
|
|
12
|
+
date: 2013-07-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: json
|
|
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
191
191
|
version: '0'
|
|
192
192
|
segments:
|
|
193
193
|
- 0
|
|
194
|
-
hash:
|
|
194
|
+
hash: 4413349439810427105
|
|
195
195
|
requirements: []
|
|
196
196
|
rubyforge_project: lazier
|
|
197
197
|
rubygems_version: 1.8.25
|