cowtech-extensions 2.7.1 → 2.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.gitignore +1 -0
  2. data/.travis.yml +4 -2
  3. data/README.md +4 -1
  4. data/doc/Cowtech.html +2 -2
  5. data/doc/Cowtech/Extensions.html +96 -93
  6. data/doc/Cowtech/Extensions/Boolean.html +10 -8
  7. data/doc/Cowtech/Extensions/DateTime.html +58 -52
  8. data/doc/Cowtech/Extensions/DateTime/ClassMethods.html +91 -79
  9. data/doc/Cowtech/Extensions/Exceptions.html +2 -2
  10. data/doc/Cowtech/Extensions/Exceptions/Dump.html +2 -2
  11. data/doc/Cowtech/Extensions/Hash.html +20 -18
  12. data/doc/Cowtech/Extensions/Math.html +2 -2
  13. data/doc/Cowtech/Extensions/Math/ClassMethods.html +24 -22
  14. data/doc/Cowtech/Extensions/Object.html +95 -81
  15. data/doc/Cowtech/Extensions/Pathname.html +11 -10
  16. data/doc/Cowtech/Extensions/Settings.html +80 -70
  17. data/doc/Cowtech/Extensions/String.html +26 -22
  18. data/doc/Cowtech/Extensions/TimeZone.html +98 -86
  19. data/doc/Cowtech/Extensions/TimeZone/ClassMethods.html +79 -72
  20. data/doc/Cowtech/Extensions/Version.html +11 -7
  21. data/doc/_index.html +2 -2
  22. data/doc/file.README.html +9 -6
  23. data/doc/index.html +9 -6
  24. data/doc/top-level-namespace.html +2 -2
  25. data/lib/cowtech-extensions.rb +2 -1
  26. data/lib/cowtech-extensions/version.rb +2 -2
  27. data/spec/cowtech-extensions/boolean_spec.rb +9 -4
  28. data/spec/cowtech-extensions/datetime_spec.rb +106 -100
  29. data/spec/cowtech-extensions/hash_spec.rb +4 -4
  30. data/spec/cowtech-extensions/math_spec.rb +8 -8
  31. data/spec/cowtech-extensions/object_spec.rb +115 -103
  32. data/spec/cowtech-extensions/pathname_spec.rb +3 -1
  33. data/spec/cowtech-extensions/settings_spec.rb +30 -30
  34. data/spec/cowtech-extensions/string_spec.rb +13 -7
  35. data/spec/cowtech-extensions_spec.rb +21 -11
  36. data/spec/spec_helper.rb +7 -1
  37. metadata +4 -4
@@ -18,13 +18,13 @@ describe Cowtech::Extensions::Hash do
18
18
  end
19
19
 
20
20
  describe "allows access to keys using method syntax" do
21
- it "should allow method reference for symbol key" do reference.b.should == 2 end
21
+ it "should allow method reference for symbol key" do expect(reference.b).to eq(2) end
22
22
  it "should use super for missing key" do expect {reference.c}.to raise_error(NoMethodError) end
23
23
  end
24
24
 
25
25
  describe "#respond_to" do
26
- it "should return true for string key" do reference.respond_to?(:a).should be_true end
27
- it "should return true for symbol key" do reference.respond_to?(:b).should be_true end
28
- it "should return false for missing key" do reference.respond_to?(:c).should be_false end
26
+ it "should return true for string key" do expect(reference.respond_to?(:a)).to be_true end
27
+ it "should return true for symbol key" do expect(reference.respond_to?(:b)).to be_true end
28
+ it "should return false for missing key" do expect(reference.respond_to?(:c)).to be_false end
29
29
  end
30
30
  end
@@ -17,25 +17,25 @@ describe Cowtech::Extensions::Math do
17
17
 
18
18
  describe "::min" do
19
19
  it "should return the minimum argument" do
20
- ::Math.min(first).should == first
21
- ::Math.min(first, second).should == first
22
- ::Math.min([first, [second, third]]).should == third
20
+ expect(::Math.min(first)).to eq(first)
21
+ expect(::Math.min(first, second)).to eq(first)
22
+ expect(::Math.min([first, [second, third]])).to eq(third)
23
23
  end
24
24
 
25
25
  it "should return nil for an empty array" do
26
- ::Math.min().should be_nil
26
+ expect(::Math.min()).to be_nil
27
27
  end
28
28
  end
29
29
 
30
30
  describe "::max" do
31
31
  it "should return the maximum argument" do
32
- ::Math.max(first).should == first
33
- ::Math.max(first, second).should == second
34
- ::Math.max([first, [second, third]]).should == second
32
+ expect(::Math.max(first)).to eq(first)
33
+ expect(::Math.max(first, second)).to eq(second)
34
+ expect(::Math.max([first, [second, third]])).to eq(second)
35
35
  end
36
36
 
37
37
  it "should return nil for an empty array" do
38
- ::Math.max().should be_nil
38
+ expect(::Math.max()).to be_nil
39
39
  end
40
40
  end
41
41
  end
@@ -13,207 +13,219 @@ describe Cowtech::Extensions::Object do
13
13
 
14
14
  describe "#normalize_number" do
15
15
  it "should correctly sanitize numbers" do
16
- 123.normalize_number.should == "123"
17
- "123.45".normalize_number.should == "123.45"
18
- "1,23.45".normalize_number.should == "123.45"
19
- "-1.23.45".normalize_number.should == "-123.45"
20
- "+123.45".normalize_number.should == "+123.45"
21
- "+1.231,45".normalize_number.should == "+1231.45"
16
+ expect(123.normalize_number).to eq("123")
17
+ expect("123.45".normalize_number).to eq("123.45")
18
+ expect("1,23.45".normalize_number).to eq("123.45")
19
+ expect("-1.23.45".normalize_number).to eq("-123.45")
20
+ expect("+123.45".normalize_number).to eq("+123.45")
21
+ expect("+1.231,45".normalize_number).to eq("+1231.45")
22
22
  end
23
23
  end
24
24
 
25
25
  describe "#is_number?" do
26
26
  it "should return true for a valid number" do
27
- "123.45".is_number?.should be_true
28
- "1,23.45".is_number?.should be_true
29
- "-1.23.45".is_number?.should be_true
30
- "+123.45".is_number?.should be_true
31
- "+1.231,45".is_number?.should be_true
27
+ expect("123.45".is_number?).to be_true
28
+ expect("1,23.45".is_number?).to be_true
29
+ expect("-1.23.45".is_number?).to be_true
30
+ expect("+123.45".is_number?).to be_true
31
+ expect("+1.231,45".is_number?).to be_true
32
32
  end
33
33
 
34
34
  it "should return true for a invalid number" do
35
- "s213".is_number?.should be_false
36
- nil.is_number?.should be_false
35
+ expect("s213".is_number?).to be_false
36
+ expect(nil.is_number?).to be_false
37
37
  end
38
38
  end
39
39
 
40
40
  describe "#is_integer?" do
41
41
  it "should return true for a valid number" do
42
- "123".is_integer?.should be_true
43
- "-123".is_integer?.should be_true
44
- "+123".is_integer?.should be_true
42
+ expect("123".is_integer?).to be_true
43
+ expect("-123".is_integer?).to be_true
44
+ expect("+123".is_integer?).to be_true
45
45
  end
46
46
 
47
47
  it "should return true for a invalid number" do
48
- "s123".is_integer?.should be_false
49
- "123.12".is_integer?.should be_false
48
+ expect("s123".is_integer?).to be_false
49
+ expect("123.12".is_integer?).to be_false
50
50
  end
51
51
  end
52
52
 
53
53
  describe "#is_float?" do
54
54
  it "should return true for a valid number" do
55
- "123.45".is_float?.should be_true
56
- "1,23.45".is_float?.should be_true
57
- "-1.23.45".is_float?.should be_true
58
- "+123.45".is_float?.should be_true
59
- "+1.231,45".is_float?.should be_true
55
+ expect("123.45".is_float?).to be_true
56
+ expect("1,23.45".is_float?).to be_true
57
+ expect("-1.23.45".is_float?).to be_true
58
+ expect("+123.45".is_float?).to be_true
59
+ expect("+1.231,45".is_float?).to be_true
60
60
  end
61
61
 
62
62
  it "should return true for a invalid number" do
63
- "s213".is_float?.should be_false
64
- nil.is_float?.should be_false
63
+ expect("s213".is_float?).to be_false
64
+ expect(nil.is_float?).to be_false
65
65
  end
66
66
  end
67
67
 
68
68
  describe "#is_boolean?" do
69
69
  it "should return true for a valid boolean" do
70
- true.is_boolean?.should be_true
71
- false.is_boolean?.should be_true
72
- nil.is_boolean?.should be_true
73
- "y".is_boolean?.should be_true
74
- "n".is_boolean?.should be_true
75
- "yes".is_boolean?.should be_true
76
- "no".is_boolean?.should be_true
77
- "1".is_boolean?.should be_true
78
- "0".is_boolean?.should be_true
79
- "true".is_boolean?.should be_true
80
- "false".is_boolean?.should be_true
81
- "t".is_boolean?.should be_true
82
- "f".is_boolean?.should be_true
83
- 1.is_boolean?.should be_true
84
- 0.is_boolean?.should be_true
85
- end
86
-
87
- it "should return true for a invalid boolean" do "11".is_boolean?.should be_false end
70
+ expect(true.is_boolean?).to be_true
71
+ expect(false.is_boolean?).to be_true
72
+ expect(nil.is_boolean?).to be_true
73
+ expect("y".is_boolean?).to be_true
74
+ expect("n".is_boolean?).to be_true
75
+ expect("yes".is_boolean?).to be_true
76
+ expect("no".is_boolean?).to be_true
77
+ expect("1".is_boolean?).to be_true
78
+ expect("0".is_boolean?).to be_true
79
+ expect("true".is_boolean?).to be_true
80
+ expect("false".is_boolean?).to be_true
81
+ expect("t".is_boolean?).to be_true
82
+ expect("f".is_boolean?).to be_true
83
+ expect(1.is_boolean?).to be_true
84
+ expect(0.is_boolean?).to be_true
85
+ end
86
+
87
+ it "should return true for a invalid boolean" do
88
+ expect("11".is_boolean?).to be_false
89
+ end
88
90
  end
89
91
 
90
92
  describe "#ensure_string" do
91
93
  it "should correctly handle strings" do
92
- " abc ".ensure_string.should == " abc "
94
+ expect(" abc ".ensure_string).to eq(" abc ")
93
95
  1.ensure_string == "1"
94
- 1.0.ensure_string.should == "1.0"
95
- :abc.ensure_string.should == "abc"
96
- nil.ensure_string.should == ""
96
+ expect(1.0.ensure_string).to eq("1.0")
97
+ expect(:abc.ensure_string).to eq("abc")
98
+ expect(nil.ensure_string).to eq("")
97
99
  end
98
100
  end
99
101
 
100
102
  describe "#to_float" do
101
103
  it "should correctly convert number" do
102
- 123.45.to_float.should == 123.45
103
- 123.to_float.should == 123.00
104
- "123.45".to_float.should == 123.45
105
- "1,23.45".to_float.should == 123.45
106
- "-1.23.45".to_float.should == -123.45
107
- "+123.45".to_float.should == 123.45
108
- "+1.231,45".to_float.should == 1231.45
104
+ expect(123.45.to_float).to eq(123.45)
105
+ expect(123.to_float).to eq(123.00)
106
+ expect("123.45".to_float).to eq(123.45)
107
+ expect("1,23.45".to_float).to eq(123.45)
108
+ expect("-1.23.45".to_float).to eq(-123.45)
109
+ expect("+123.45".to_float).to eq(123.45)
110
+ expect("+1.231,45".to_float).to eq(1231.45)
109
111
  end
110
112
 
111
- it "should return 0.0 for a invalid number without a default" do "s213".to_float.should == 0.0 end
113
+ it "should return 0.0 for a invalid number without a default" do
114
+ expect("s213".to_float).to eq(0.0)
115
+ end
112
116
 
113
- it "should return the default for a invalid number" do "s213".to_float(1.0).should == 1.0 end
117
+ it "should return the default for a invalid number" do
118
+ expect("s213".to_float(1.0)).to eq(1.0)
119
+ end
114
120
  end
115
121
 
116
122
  describe "#to_integer" do
117
123
  it "should correctly convert number" do
118
- 123.45.to_integer.should == 123
119
- 123.to_integer.should == 123
120
- "+123".to_integer.should == 123
121
- "-123".to_integer.should == -123
124
+ expect(123.45.to_integer).to eq(123)
125
+ expect(123.to_integer).to eq(123)
126
+ expect("+123".to_integer).to eq(123)
127
+ expect("-123".to_integer).to eq(-123)
122
128
  end
123
129
 
124
- it "should return 0 for a invalid number without a default" do "s213".to_integer.should == 0 end
130
+ it "should return 0 for a invalid number without a default" do
131
+ expect("s213".to_integer).to eq(0)
132
+ end
125
133
 
126
- it "should return the default for a invalid number" do "s213".to_integer(1).should == 1 end
134
+ it "should return the default for a invalid number" do
135
+ expect("s213".to_integer(1)).to eq(1)
136
+ end
127
137
  end
128
138
 
129
139
  describe "#to_boolean" do
130
140
  it "should return true for a valid true boolean" do
131
- true.to_boolean.should be_true
132
- "y".to_boolean.should be_true
133
- "yes".to_boolean.should be_true
134
- "1".to_boolean.should be_true
135
- 1.to_boolean.should be_true
136
- 1.0.to_boolean.should be_true
141
+ expect(true.to_boolean).to be_true
142
+ expect("y".to_boolean).to be_true
143
+ expect("yes".to_boolean).to be_true
144
+ expect("1".to_boolean).to be_true
145
+ expect(1.to_boolean).to be_true
146
+ expect(1.0.to_boolean).to be_true
137
147
  end
138
148
 
139
149
  it "should return false for all other values" do
140
- false.to_boolean.should be_false
141
- nil.to_boolean.should be_false
142
- "n".to_boolean.should be_false
143
- "no".to_boolean.should be_false
144
- "2".to_boolean.should be_false
145
- 2.0.to_boolean.should be_false
146
- "false".to_boolean.should be_false
147
- "abc".to_boolean.should be_false
148
- 0.to_boolean.should be_false
150
+ expect(false.to_boolean).to be_false
151
+ expect(nil.to_boolean).to be_false
152
+ expect("n".to_boolean).to be_false
153
+ expect("no".to_boolean).to be_false
154
+ expect("2".to_boolean).to be_false
155
+ expect(2.0.to_boolean).to be_false
156
+ expect("false".to_boolean).to be_false
157
+ expect("abc".to_boolean).to be_false
158
+ expect(0.to_boolean).to be_false
149
159
  end
150
160
  end
151
161
 
152
162
  describe "#round_to_precision" do
153
163
  it "should round number" do
154
- 123.456789.round_to_precision(2).should == "123.46"
155
- 123.456789.round_to_precision(0).should == "123"
156
- "123.456789".round_to_precision(2).should == "123.46"
164
+ expect(123.456789.round_to_precision(2)).to eq("123.46")
165
+ expect(123.456789.round_to_precision(0)).to eq("123")
166
+ expect("123.456789".round_to_precision(2)).to eq("123.46")
157
167
  end
158
168
 
159
169
  it "should return nil for non numeric values" do
160
- 123.456789.round_to_precision(-1).should == nil
161
- "abc".round_to_precision(-1).should == nil
170
+ expect(123.456789.round_to_precision(-1)).to eq(nil)
171
+ expect("abc".round_to_precision(-1)).to eq(nil)
162
172
  end
163
173
  end
164
174
 
165
175
  describe "#format_number" do
166
176
  it "should format number" do
167
- 123123.456789.format_number.should == "123,123.46"
168
- 123123.456789.format_number(2).should == "123,123.46"
169
- 123123.456789.format_number(3, "@").should == "123,123@457"
170
- 123123.456789.format_number(3, "@", "$").should == "123,123@457 $"
171
- "123123.456789".format_number(3, "@", "$", "!").should == "123!123@457 $"
177
+ expect(123123.456789.format_number).to eq("123,123.46")
178
+ expect(123123.456789.format_number(2)).to eq("123,123.46")
179
+ expect(123123.456789.format_number(3, "@")).to eq("123,123@457")
180
+ expect(123123.456789.format_number(3, "@", "$")).to eq("123,123@457 $")
181
+ expect("123123.456789".format_number(3, "@", "$", "!")).to eq("123!123@457 $")
172
182
 
173
183
  Cowtech::Extensions.settings.setup_format_number(5, ",", "£", ".")
174
- 123123.456789.format_number.should == "123.123,45679 £"
184
+ expect(123123.456789.format_number).to eq("123.123,45679 £")
175
185
  end
176
186
 
177
187
  it "should return nil for non numeric values" do
178
- 123.456789.format_number(-1).should == nil
179
- "abc".format_number(-1).should == nil
188
+ expect(123.456789.format_number(-1)).to eq(nil)
189
+ expect("abc".format_number(-1)).to eq(nil)
180
190
  end
181
191
  end
182
192
 
183
193
  describe "#format_boolean" do
184
194
  it "should return the correct string for all values" do
185
- "yes".format_boolean.should == "Yes"
186
- "abc".format_boolean.should == "No"
195
+ expect("yes".format_boolean).to eq("Yes")
196
+ expect("abc".format_boolean).to eq("No")
187
197
  end
188
198
 
189
199
  it "should support localization" do
190
200
  Cowtech::Extensions.settings.setup_boolean_names("YYY", "NNN")
191
- "yes".format_boolean.should == "YYY"
192
- "abc".format_boolean.should == "NNN"
201
+ expect("yes".format_boolean).to eq("YYY")
202
+ expect("abc".format_boolean).to eq("NNN")
193
203
  end
194
204
 
195
205
  it "should support overrides" do
196
206
  Cowtech::Extensions.settings.setup_boolean_names
197
- "yes".format_boolean("TTT").should == "TTT"
198
- "yes".format_boolean(nil, "FFF").should == "Yes"
199
- "abc".format_boolean("TTT").should == "No"
200
- "abc".format_boolean(nil, "FFF").should == "FFF"
207
+ expect("yes".format_boolean("TTT")).to eq("TTT")
208
+ expect("yes".format_boolean(nil, "FFF")).to eq("Yes")
209
+ expect("abc".format_boolean("TTT")).to eq("No")
210
+ expect("abc".format_boolean(nil, "FFF")).to eq("FFF")
201
211
  end
202
212
  end
203
213
 
204
214
  describe "#debug_dump" do
205
215
  it "should return the correct representation for an object" do
206
216
  reference = {:a => "b"}
207
- reference.debug_dump(:json, false).should == reference.to_json
208
- reference.debug_dump(:pretty_json, false).should == ::JSON.pretty_generate(reference)
209
- reference.debug_dump(:yaml, false).should == reference.to_yaml
217
+ expect(reference.debug_dump(:json, false)).to eq(reference.to_json)
218
+ expect(reference.debug_dump(:pretty_json, false)).to eq(::JSON.pretty_generate(reference))
219
+ expect(reference.debug_dump(:yaml, false)).to eq(reference.to_yaml)
210
220
  end
211
221
 
212
222
  it "should inspect the object if the format is not recognized" do
213
223
  reference = {:a => "b"}
214
- reference.debug_dump(:unknown, false).should == reference.inspect
224
+ expect(reference.debug_dump(:unknown, false)).to eq(reference.inspect)
215
225
  end
216
226
 
217
- it "should raise an exception if requested" do expect { {:a => "b"}.debug_dump }.to raise_error(::Cowtech::Extensions::Exceptions::Dump) end
227
+ it "should raise an exception if requested" do
228
+ expect { {:a => "b"}.debug_dump }.to raise_error(::Cowtech::Extensions::Exceptions::Dump)
229
+ end
218
230
  end
219
231
  end
@@ -14,6 +14,8 @@ describe Cowtech::Extensions::Pathname do
14
14
  end
15
15
 
16
16
  describe "#components" do
17
- it "should return the components of the path" do ([""] + reference.components).should == reference.to_s.split("/") end
17
+ it "should return the components of the path" do
18
+ expect([""] + reference.components).to eq(reference.to_s.split("/"))
19
+ end
18
20
  end
19
21
  end
@@ -18,52 +18,52 @@ describe Cowtech::Extensions::Settings do
18
18
  describe "#initialize" do
19
19
  it "should create good defaults" do
20
20
  settings = ::Cowtech::Extensions::Settings.new
21
- settings.format_number.should be_a(Hash)
22
- settings.boolean_names.should be_a(Hash)
23
- settings.date_names.should be_a(Hash)
24
- settings.date_formats.should be_a(Hash)
21
+ expect(settings.format_number).to be_a(Hash)
22
+ expect(settings.boolean_names).to be_a(Hash)
23
+ expect(settings.date_names).to be_a(Hash)
24
+ expect(settings.date_formats).to be_a(Hash)
25
25
  end
26
26
 
27
27
  it "should create good defaults for the singleton" do
28
- reference.format_number.should be_a(Hash)
29
- reference.boolean_names.should be_a(Hash)
30
- reference.date_names.should be_a(Hash)
31
- reference.date_formats.should be_a(Hash)
28
+ expect(reference.format_number).to be_a(Hash)
29
+ expect(reference.boolean_names).to be_a(Hash)
30
+ expect(reference.date_names).to be_a(Hash)
31
+ expect(reference.date_formats).to be_a(Hash)
32
32
  end
33
33
  end
34
34
 
35
35
  describe "#setup_format_number" do
36
36
  it "should save format numbering options for usage" do
37
37
  reference.setup_format_number(2)
38
- number_reference.format_number.should == "123,456.65"
38
+ expect(number_reference.format_number).to eq("123,456.65")
39
39
 
40
40
  reference.setup_format_number(3, "A")
41
- number_reference.format_number.should == "123,456A654"
41
+ expect(number_reference.format_number).to eq("123,456A654")
42
42
 
43
43
  reference.setup_format_number(4, "A", "B")
44
- number_reference.format_number.should == "123,456A6543 B"
44
+ expect(number_reference.format_number).to eq("123,456A6543 B")
45
45
 
46
46
  reference.setup_format_number(5, "A", "B", "C")
47
- number_reference.format_number.should == "123C456A65432 B"
47
+ expect(number_reference.format_number).to eq("123C456A65432 B")
48
48
 
49
49
  reference.setup_format_number
50
- number_reference.format_number.should == "123,456.65"
50
+ expect(number_reference.format_number).to eq("123,456.65")
51
51
  end
52
52
  end
53
53
 
54
54
  describe "#setup_boolean_names" do
55
55
  it "should save names for boolean values" do
56
56
  reference.setup_boolean_names("TRUE1")
57
- [true.format_boolean, false.format_boolean].should == ["TRUE1", "No"]
57
+ expect([true.format_boolean, false.format_boolean]).to eq(["TRUE1", "No"])
58
58
 
59
59
  reference.setup_boolean_names(nil, "FALSE1")
60
- [true.format_boolean, false.format_boolean].should == ["Yes", "FALSE1"]
60
+ expect([true.format_boolean, false.format_boolean]).to eq(["Yes", "FALSE1"])
61
61
 
62
62
  reference.setup_boolean_names("TRUE2", "FALSE2")
63
- [true.format_boolean, false.format_boolean].should == ["TRUE2", "FALSE2"]
63
+ expect([true.format_boolean, false.format_boolean]).to eq(["TRUE2", "FALSE2"])
64
64
 
65
65
  reference.setup_boolean_names
66
- [true.format_boolean, false.format_boolean].should == ["Yes", "No"]
66
+ expect([true.format_boolean, false.format_boolean]).to eq(["Yes", "No"])
67
67
  end
68
68
  end
69
69
 
@@ -72,20 +72,20 @@ describe Cowtech::Extensions::Settings do
72
72
  reference.setup_date_formats(nil, true)
73
73
 
74
74
  reference.setup_date_formats({:c1 => "%Y"})
75
- date_reference.lstrftime(:ct_date) == date_reference.strftime("%Y-%m-%d")
76
- date_reference.lstrftime(:c1) == date_reference.year.to_s
75
+ expect(date_reference.lstrftime(:ct_date)).to eq(date_reference.strftime("%Y-%m-%d"))
76
+ expect(date_reference.lstrftime(:c1)).to eq(date_reference.year.to_s)
77
77
 
78
78
  reference.setup_date_formats({:c1 => "%Y"}, true)
79
- date_reference.lstrftime(:ct_date).should == "ct_date"
80
- date_reference.lstrftime(:c1).should == date_reference.year.to_s
79
+ expect(date_reference.lstrftime(:ct_date)).to eq("ct_date")
80
+ expect(date_reference.lstrftime(:c1)).to eq(date_reference.year.to_s)
81
81
 
82
82
  reference.setup_date_formats()
83
- date_reference.lstrftime(:ct_date).should == date_reference.strftime("%Y-%m-%d")
84
- date_reference.lstrftime(:c1).should == date_reference.year.to_s
83
+ expect(date_reference.lstrftime(:ct_date)).to eq(date_reference.strftime("%Y-%m-%d"))
84
+ expect(date_reference.lstrftime(:c1)).to eq(date_reference.year.to_s)
85
85
 
86
86
  reference.setup_date_formats(nil, true)
87
- date_reference.lstrftime(:ct_date) == date_reference.strftime("%Y-%m-d")
88
- date_reference.lstrftime(:c1).should == "c1"
87
+ expect(date_reference.lstrftime(:ct_date)).to eq(date_reference.strftime("%Y-%m-%d"))
88
+ expect(date_reference.lstrftime(:c1)).to eq("c1")
89
89
  end
90
90
  end
91
91
 
@@ -100,19 +100,19 @@ describe Cowtech::Extensions::Settings do
100
100
  short_days = 7.times.collect {|i| (i + 1).to_s}
101
101
 
102
102
  reference.setup_date_names(long_months)
103
- date_reference.lstrftime(:sdn).should == "66 Jun Tuesday Tue"
103
+ expect(date_reference.lstrftime(:sdn)).to eq("66 Jun Tuesday Tue")
104
104
 
105
105
  reference.setup_date_names(long_months, short_months)
106
- date_reference.lstrftime(:sdn).should == "66 6 Tuesday Tue"
106
+ expect(date_reference.lstrftime(:sdn)).to eq("66 6 Tuesday Tue")
107
107
 
108
108
  reference.setup_date_names(long_months, short_months, long_days)
109
- date_reference.lstrftime(:sdn).should == "66 6 33 Tue"
109
+ expect(date_reference.lstrftime(:sdn)).to eq("66 6 33 Tue")
110
110
 
111
111
  reference.setup_date_names(long_months, short_months, long_days, short_days)
112
- date_reference.lstrftime(:sdn).should == "66 6 33 3"
112
+ expect(date_reference.lstrftime(:sdn)).to eq("66 6 33 3")
113
113
 
114
114
  reference.setup_date_names
115
- date_reference.lstrftime(:sdn).should == "June Jun Tuesday Tue"
115
+ expect(date_reference.lstrftime(:sdn)).to eq("June Jun Tuesday Tue")
116
116
  end
117
117
  end
118
118
  end