string_foundation 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +9 -9
- data/Gemfile.lock +19 -19
- data/{LICENSE.txt → LICENSE} +1 -1
- data/PULL_REQUEST_TEMPLATE.md +14 -0
- data/README.md +244 -104
- data/Rakefile +3 -3
- data/bin/console +1 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/application.css +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/application.js +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/colorbox/border.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/colorbox/controls.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/colorbox/loading.gif +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/colorbox/loading_background.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/favicon_green.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/favicon_red.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/favicon_yellow.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/loading.gif +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/magnify.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/{0.10.0 → 0.10.2}/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/index.html +5885 -3160
- data/lib/string_foundation.rb +4 -2
- data/lib/string_foundation/blank.rb +17 -0
- data/lib/string_foundation/case.rb +28 -38
- data/lib/string_foundation/convert.rb +9 -9
- data/lib/string_foundation/convertible.rb +4 -4
- data/lib/string_foundation/is.rb +13 -0
- data/lib/string_foundation/length.rb +56 -0
- data/lib/string_foundation/like.rb +4 -4
- data/lib/string_foundation/version.rb +2 -2
- data/lib/string_foundation/with.rb +7 -7
- data/pkg/string_foundation-1.1.0.gem +0 -0
- data/spec/spec_helper.rb +10 -10
- data/spec/string_foundation/blank_spec.rb +91 -0
- data/spec/string_foundation/case_spec.rb +398 -433
- data/spec/string_foundation/convert_spec.rb +98 -98
- data/spec/string_foundation/convertible_spec.rb +286 -0
- data/spec/string_foundation/is_spec.rb +62 -0
- data/spec/string_foundation/length_spec.rb +226 -0
- data/spec/string_foundation/like_spec.rb +103 -103
- data/spec/string_foundation/version_spec.rb +4 -4
- data/spec/string_foundation/with_spec.rb +48 -48
- data/spec/support/enhanced_matchers_extension.rb +1 -0
- data/string_foundation.gemspec +15 -14
- metadata +46 -37
- data/circle.yml +0 -14
- data/pkg/string_foundation-1.0.0.gem +0 -0
- data/spec/string_foundation/convertaile_spec.rb +0 -286
@@ -1,99 +1,99 @@
|
|
1
1
|
# ==============================================================================
|
2
|
-
# SPEC - STRING FOUNDATION - CASE
|
3
|
-
# ==============================================================================
|
2
|
+
# SPEC - STRING FOUNDATION - CASE SPEC
|
4
3
|
# frozen_string_literal: true
|
5
|
-
|
4
|
+
# ==============================================================================
|
5
|
+
describe "[ Case Methods ]" do
|
6
6
|
# Define shared contexts.
|
7
7
|
# ----------------------------------------------------------------------------
|
8
|
-
shared_context
|
9
|
-
shared_context
|
10
|
-
shared_context
|
11
|
-
shared_context
|
12
|
-
shared_context
|
13
|
-
shared_context
|
14
|
-
shared_context
|
15
|
-
shared_context
|
16
|
-
shared_context
|
17
|
-
shared_context
|
18
|
-
shared_context
|
8
|
+
shared_context "one word" do let(:string) { "string" } end
|
9
|
+
shared_context "lowerCamelCase" do let(:string) { "iAmJagaApple" } end
|
10
|
+
shared_context "UpperCamelCase" do let(:string) { "IAmJagaApple" } end
|
11
|
+
shared_context "lower_snake_case" do let(:string) { "I_am_jaga_apple" } end
|
12
|
+
shared_context "Upper_Snake_Case" do let(:string) { "I_Am_Jaga_Apple" } end
|
13
|
+
shared_context "lower-kebab-case" do let(:string) { "i-am-jaga-apple" } end
|
14
|
+
shared_context "Upper-Kebab-Case" do let(:string) { "I-Am-Jaga-Apple" } end
|
15
|
+
shared_context "lower space case" do let(:string) { "i am jaga apple" } end
|
16
|
+
shared_context "Upper Space Case" do let(:string) { "I Am Jaga Apple" } end
|
17
|
+
shared_context "lower.dot.case" do let(:string) { "i.am.jaga.apple" } end
|
18
|
+
shared_context "Upper.Dot.Case" do let(:string) { "I.Am.Jaga.Apple" } end
|
19
19
|
# ----------------------------------------------------------------------------
|
20
20
|
|
21
21
|
# ----------------------------------------------------------------------------
|
22
22
|
# Convert to lowerCamelCase
|
23
23
|
# ----------------------------------------------------------------------------
|
24
|
-
describe
|
24
|
+
describe "CONVERT TO lowerCamelCase ::" do
|
25
25
|
subject { string.to_lcamel }
|
26
26
|
|
27
27
|
# Define shared examples.
|
28
28
|
# --------------------------------------------------------------------------
|
29
|
-
shared_examples
|
30
|
-
it { is_expected.to eq
|
29
|
+
shared_examples "be converted to lowerCamelCase" do
|
30
|
+
it { is_expected.to eq("iAmJagaApple") }
|
31
31
|
end
|
32
32
|
# --------------------------------------------------------------------------
|
33
33
|
|
34
|
-
context
|
35
|
-
include_context
|
34
|
+
context "When a string has one word," do
|
35
|
+
include_context "one word"
|
36
36
|
|
37
|
-
it { is_expected.to eq
|
37
|
+
it { is_expected.to eq("string") }
|
38
38
|
end
|
39
39
|
|
40
|
-
context
|
41
|
-
include_context
|
40
|
+
context "When a string lowerCamelCase," do
|
41
|
+
include_context "lowerCamelCase"
|
42
42
|
|
43
|
-
it_behaves_like
|
43
|
+
it_behaves_like "be converted to lowerCamelCase"
|
44
44
|
end
|
45
45
|
|
46
|
-
context
|
47
|
-
include_context
|
46
|
+
context "When a string UpperCamelCase," do
|
47
|
+
include_context "UpperCamelCase"
|
48
48
|
|
49
|
-
it_behaves_like
|
49
|
+
it_behaves_like "be converted to lowerCamelCase"
|
50
50
|
end
|
51
51
|
|
52
|
-
context
|
53
|
-
include_context
|
52
|
+
context "When a string lower_snake_case," do
|
53
|
+
include_context "lower_snake_case"
|
54
54
|
|
55
|
-
it_behaves_like
|
55
|
+
it_behaves_like "be converted to lowerCamelCase"
|
56
56
|
end
|
57
57
|
|
58
|
-
context
|
59
|
-
include_context
|
58
|
+
context "When a string Upper_Snake_Case," do
|
59
|
+
include_context "Upper_Snake_Case"
|
60
60
|
|
61
|
-
it_behaves_like
|
61
|
+
it_behaves_like "be converted to lowerCamelCase"
|
62
62
|
end
|
63
63
|
|
64
|
-
context
|
65
|
-
include_context
|
64
|
+
context "When a string lower-kebab-case," do
|
65
|
+
include_context "lower-kebab-case"
|
66
66
|
|
67
|
-
it_behaves_like
|
67
|
+
it_behaves_like "be converted to lowerCamelCase"
|
68
68
|
end
|
69
69
|
|
70
|
-
context
|
71
|
-
include_context
|
70
|
+
context "When a string Upper-Kebab-Case," do
|
71
|
+
include_context "Upper-Kebab-Case"
|
72
72
|
|
73
|
-
it_behaves_like
|
73
|
+
it_behaves_like "be converted to lowerCamelCase"
|
74
74
|
end
|
75
75
|
|
76
|
-
context
|
77
|
-
include_context
|
76
|
+
context "When a string lower space case," do
|
77
|
+
include_context "lower space case"
|
78
78
|
|
79
|
-
it_behaves_like
|
79
|
+
it_behaves_like "be converted to lowerCamelCase"
|
80
80
|
end
|
81
81
|
|
82
|
-
context
|
83
|
-
include_context
|
82
|
+
context "When a string Upper Space Case," do
|
83
|
+
include_context "Upper Space Case"
|
84
84
|
|
85
|
-
it_behaves_like
|
85
|
+
it_behaves_like "be converted to lowerCamelCase"
|
86
86
|
end
|
87
|
-
context
|
88
|
-
include_context
|
87
|
+
context "When a string lower.dot.case," do
|
88
|
+
include_context "lower.dot.case"
|
89
89
|
|
90
|
-
it_behaves_like
|
90
|
+
it_behaves_like "be converted to lowerCamelCase"
|
91
91
|
end
|
92
92
|
|
93
|
-
context
|
94
|
-
include_context
|
93
|
+
context "When a string Upper.Dot.Case," do
|
94
|
+
include_context "Upper.Dot.Case"
|
95
95
|
|
96
|
-
it_behaves_like
|
96
|
+
it_behaves_like "be converted to lowerCamelCase"
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -101,79 +101,79 @@ describe '[ Case Methods ]' do
|
|
101
101
|
# ----------------------------------------------------------------------------
|
102
102
|
# Convert to UpperCamelCase
|
103
103
|
# ----------------------------------------------------------------------------
|
104
|
-
describe
|
104
|
+
describe "CONVERT TO UpperCamelCase ::" do
|
105
105
|
subject { string.to_ucamel }
|
106
106
|
|
107
107
|
# Define shared examples.
|
108
108
|
# --------------------------------------------------------------------------
|
109
|
-
shared_examples
|
110
|
-
it { is_expected.to eq
|
109
|
+
shared_examples "be converted to UpperCamelCase" do
|
110
|
+
it { is_expected.to eq("IAmJagaApple") }
|
111
111
|
end
|
112
112
|
# --------------------------------------------------------------------------
|
113
113
|
|
114
|
-
context
|
115
|
-
include_context
|
114
|
+
context "When a string has one word," do
|
115
|
+
include_context "one word"
|
116
116
|
|
117
|
-
it { is_expected.to eq
|
117
|
+
it { is_expected.to eq("String") }
|
118
118
|
end
|
119
119
|
|
120
|
-
context
|
121
|
-
include_context
|
120
|
+
context "When a string lowerCamelCase," do
|
121
|
+
include_context "lowerCamelCase"
|
122
122
|
|
123
|
-
it_behaves_like
|
123
|
+
it_behaves_like "be converted to UpperCamelCase"
|
124
124
|
end
|
125
125
|
|
126
|
-
context
|
127
|
-
include_context
|
126
|
+
context "When a string UpperCamelCase," do
|
127
|
+
include_context "UpperCamelCase"
|
128
128
|
|
129
|
-
it_behaves_like
|
129
|
+
it_behaves_like "be converted to UpperCamelCase"
|
130
130
|
end
|
131
131
|
|
132
|
-
context
|
133
|
-
include_context
|
132
|
+
context "When a string lower_snake_case," do
|
133
|
+
include_context "lower_snake_case"
|
134
134
|
|
135
|
-
it_behaves_like
|
135
|
+
it_behaves_like "be converted to UpperCamelCase"
|
136
136
|
end
|
137
137
|
|
138
|
-
context
|
139
|
-
include_context
|
138
|
+
context "When a string Upper_Snake_Case," do
|
139
|
+
include_context "Upper_Snake_Case"
|
140
140
|
|
141
|
-
it_behaves_like
|
141
|
+
it_behaves_like "be converted to UpperCamelCase"
|
142
142
|
end
|
143
143
|
|
144
|
-
context
|
145
|
-
include_context
|
144
|
+
context "When a string lower-kebab-case," do
|
145
|
+
include_context "lower-kebab-case"
|
146
146
|
|
147
|
-
it_behaves_like
|
147
|
+
it_behaves_like "be converted to UpperCamelCase"
|
148
148
|
end
|
149
149
|
|
150
|
-
context
|
151
|
-
include_context
|
150
|
+
context "When a string Upper-Kebab-Case," do
|
151
|
+
include_context "Upper-Kebab-Case"
|
152
152
|
|
153
|
-
it_behaves_like
|
153
|
+
it_behaves_like "be converted to UpperCamelCase"
|
154
154
|
end
|
155
155
|
|
156
|
-
context
|
157
|
-
include_context
|
156
|
+
context "When a string lower space case," do
|
157
|
+
include_context "lower space case"
|
158
158
|
|
159
|
-
it_behaves_like
|
159
|
+
it_behaves_like "be converted to UpperCamelCase"
|
160
160
|
end
|
161
161
|
|
162
|
-
context
|
163
|
-
include_context
|
162
|
+
context "When a string Upper Space Case," do
|
163
|
+
include_context "Upper Space Case"
|
164
164
|
|
165
|
-
it_behaves_like
|
165
|
+
it_behaves_like "be converted to UpperCamelCase"
|
166
166
|
end
|
167
|
-
context
|
168
|
-
include_context
|
167
|
+
context "When a string lower.dot.case," do
|
168
|
+
include_context "lower.dot.case"
|
169
169
|
|
170
|
-
it_behaves_like
|
170
|
+
it_behaves_like "be converted to UpperCamelCase"
|
171
171
|
end
|
172
172
|
|
173
|
-
context
|
174
|
-
include_context
|
173
|
+
context "When a string Upper.Dot.Case," do
|
174
|
+
include_context "Upper.Dot.Case"
|
175
175
|
|
176
|
-
it_behaves_like
|
176
|
+
it_behaves_like "be converted to UpperCamelCase"
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
@@ -181,79 +181,79 @@ describe '[ Case Methods ]' do
|
|
181
181
|
# ----------------------------------------------------------------------------
|
182
182
|
# Convert to lower_snake_case
|
183
183
|
# ----------------------------------------------------------------------------
|
184
|
-
describe
|
184
|
+
describe "CONVERT TO lower_snake_case ::" do
|
185
185
|
subject { string.to_lsnake }
|
186
186
|
|
187
187
|
# Define shared examples.
|
188
188
|
# --------------------------------------------------------------------------
|
189
|
-
shared_examples
|
190
|
-
it { is_expected.to eq
|
189
|
+
shared_examples "be converted to lower_snake_case" do
|
190
|
+
it { is_expected.to eq("i_am_jaga_apple") }
|
191
191
|
end
|
192
192
|
# --------------------------------------------------------------------------
|
193
193
|
|
194
|
-
context
|
195
|
-
include_context
|
194
|
+
context "When a string has one word," do
|
195
|
+
include_context "one word"
|
196
196
|
|
197
|
-
it { is_expected.to eq
|
197
|
+
it { is_expected.to eq("string") }
|
198
198
|
end
|
199
199
|
|
200
|
-
context
|
201
|
-
include_context
|
200
|
+
context "When a string lowerCamelCase," do
|
201
|
+
include_context "lowerCamelCase"
|
202
202
|
|
203
|
-
it_behaves_like
|
203
|
+
it_behaves_like "be converted to lower_snake_case"
|
204
204
|
end
|
205
205
|
|
206
|
-
context
|
207
|
-
include_context
|
206
|
+
context "When a string UpperCamelCase," do
|
207
|
+
include_context "UpperCamelCase"
|
208
208
|
|
209
|
-
it_behaves_like
|
209
|
+
it_behaves_like "be converted to lower_snake_case"
|
210
210
|
end
|
211
211
|
|
212
|
-
context
|
213
|
-
include_context
|
212
|
+
context "When a string lower_snake_case," do
|
213
|
+
include_context "lower_snake_case"
|
214
214
|
|
215
|
-
it_behaves_like
|
215
|
+
it_behaves_like "be converted to lower_snake_case"
|
216
216
|
end
|
217
217
|
|
218
|
-
context
|
219
|
-
include_context
|
218
|
+
context "When a string Upper_Snake_Case," do
|
219
|
+
include_context "Upper_Snake_Case"
|
220
220
|
|
221
|
-
it_behaves_like
|
221
|
+
it_behaves_like "be converted to lower_snake_case"
|
222
222
|
end
|
223
223
|
|
224
|
-
context
|
225
|
-
include_context
|
224
|
+
context "When a string lower-kebab-case," do
|
225
|
+
include_context "lower-kebab-case"
|
226
226
|
|
227
|
-
it_behaves_like
|
227
|
+
it_behaves_like "be converted to lower_snake_case"
|
228
228
|
end
|
229
229
|
|
230
|
-
context
|
231
|
-
include_context
|
230
|
+
context "When a string Upper-Kebab-Case," do
|
231
|
+
include_context "Upper-Kebab-Case"
|
232
232
|
|
233
|
-
it_behaves_like
|
233
|
+
it_behaves_like "be converted to lower_snake_case"
|
234
234
|
end
|
235
235
|
|
236
|
-
context
|
237
|
-
include_context
|
236
|
+
context "When a string lower space case," do
|
237
|
+
include_context "lower space case"
|
238
238
|
|
239
|
-
it_behaves_like
|
239
|
+
it_behaves_like "be converted to lower_snake_case"
|
240
240
|
end
|
241
241
|
|
242
|
-
context
|
243
|
-
include_context
|
242
|
+
context "When a string Upper Space Case," do
|
243
|
+
include_context "Upper Space Case"
|
244
244
|
|
245
|
-
it_behaves_like
|
245
|
+
it_behaves_like "be converted to lower_snake_case"
|
246
246
|
end
|
247
|
-
context
|
248
|
-
include_context
|
247
|
+
context "When a string lower.dot.case," do
|
248
|
+
include_context "lower.dot.case"
|
249
249
|
|
250
|
-
it_behaves_like
|
250
|
+
it_behaves_like "be converted to lower_snake_case"
|
251
251
|
end
|
252
252
|
|
253
|
-
context
|
254
|
-
include_context
|
253
|
+
context "When a string Upper.Dot.Case," do
|
254
|
+
include_context "Upper.Dot.Case"
|
255
255
|
|
256
|
-
it_behaves_like
|
256
|
+
it_behaves_like "be converted to lower_snake_case"
|
257
257
|
end
|
258
258
|
end
|
259
259
|
|
@@ -261,79 +261,79 @@ describe '[ Case Methods ]' do
|
|
261
261
|
# ----------------------------------------------------------------------------
|
262
262
|
# Convert to Upper_Snake_Case
|
263
263
|
# ----------------------------------------------------------------------------
|
264
|
-
describe
|
264
|
+
describe "CONVERT TO Upper_Snake_Case ::" do
|
265
265
|
subject { string.to_usnake }
|
266
266
|
|
267
267
|
# Define shared examples.
|
268
268
|
# --------------------------------------------------------------------------
|
269
|
-
shared_examples
|
270
|
-
it { is_expected.to eq
|
269
|
+
shared_examples "be converted to Upper_Snake_Case" do
|
270
|
+
it { is_expected.to eq("I_Am_Jaga_Apple") }
|
271
271
|
end
|
272
272
|
# --------------------------------------------------------------------------
|
273
273
|
|
274
|
-
context
|
275
|
-
include_context
|
274
|
+
context "When a string has one word," do
|
275
|
+
include_context "one word"
|
276
276
|
|
277
|
-
it { is_expected.to eq
|
277
|
+
it { is_expected.to eq("String") }
|
278
278
|
end
|
279
279
|
|
280
|
-
context
|
281
|
-
include_context
|
280
|
+
context "When a string lowerCamelCase," do
|
281
|
+
include_context "lowerCamelCase"
|
282
282
|
|
283
|
-
it_behaves_like
|
283
|
+
it_behaves_like "be converted to Upper_Snake_Case"
|
284
284
|
end
|
285
285
|
|
286
|
-
context
|
287
|
-
include_context
|
286
|
+
context "When a string UpperCamelCase," do
|
287
|
+
include_context "UpperCamelCase"
|
288
288
|
|
289
|
-
it_behaves_like
|
289
|
+
it_behaves_like "be converted to Upper_Snake_Case"
|
290
290
|
end
|
291
291
|
|
292
|
-
context
|
293
|
-
include_context
|
292
|
+
context "When a string lower_snake_case," do
|
293
|
+
include_context "lower_snake_case"
|
294
294
|
|
295
|
-
it_behaves_like
|
295
|
+
it_behaves_like "be converted to Upper_Snake_Case"
|
296
296
|
end
|
297
297
|
|
298
|
-
context
|
299
|
-
include_context
|
298
|
+
context "When a string Upper_Snake_Case," do
|
299
|
+
include_context "Upper_Snake_Case"
|
300
300
|
|
301
|
-
it_behaves_like
|
301
|
+
it_behaves_like "be converted to Upper_Snake_Case"
|
302
302
|
end
|
303
303
|
|
304
|
-
context
|
305
|
-
include_context
|
304
|
+
context "When a string lower-kebab-case," do
|
305
|
+
include_context "lower-kebab-case"
|
306
306
|
|
307
|
-
it_behaves_like
|
307
|
+
it_behaves_like "be converted to Upper_Snake_Case"
|
308
308
|
end
|
309
309
|
|
310
|
-
context
|
311
|
-
include_context
|
310
|
+
context "When a string Upper-Kebab-Case," do
|
311
|
+
include_context "Upper-Kebab-Case"
|
312
312
|
|
313
|
-
it_behaves_like
|
313
|
+
it_behaves_like "be converted to Upper_Snake_Case"
|
314
314
|
end
|
315
315
|
|
316
|
-
context
|
317
|
-
include_context
|
316
|
+
context "When a string lower space case," do
|
317
|
+
include_context "lower space case"
|
318
318
|
|
319
|
-
it_behaves_like
|
319
|
+
it_behaves_like "be converted to Upper_Snake_Case"
|
320
320
|
end
|
321
321
|
|
322
|
-
context
|
323
|
-
include_context
|
322
|
+
context "When a string Upper Space Case," do
|
323
|
+
include_context "Upper Space Case"
|
324
324
|
|
325
|
-
it_behaves_like
|
325
|
+
it_behaves_like "be converted to Upper_Snake_Case"
|
326
326
|
end
|
327
|
-
context
|
328
|
-
include_context
|
327
|
+
context "When a string lower.dot.case," do
|
328
|
+
include_context "lower.dot.case"
|
329
329
|
|
330
|
-
it_behaves_like
|
330
|
+
it_behaves_like "be converted to Upper_Snake_Case"
|
331
331
|
end
|
332
332
|
|
333
|
-
context
|
334
|
-
include_context
|
333
|
+
context "When a string Upper.Dot.Case," do
|
334
|
+
include_context "Upper.Dot.Case"
|
335
335
|
|
336
|
-
it_behaves_like
|
336
|
+
it_behaves_like "be converted to Upper_Snake_Case"
|
337
337
|
end
|
338
338
|
end
|
339
339
|
|
@@ -341,79 +341,79 @@ describe '[ Case Methods ]' do
|
|
341
341
|
# ----------------------------------------------------------------------------
|
342
342
|
# Convert to lower-kebab-case
|
343
343
|
# ----------------------------------------------------------------------------
|
344
|
-
describe
|
344
|
+
describe "CONVERT TO lower-kebab-case ::" do
|
345
345
|
subject { string.to_lkebab }
|
346
346
|
|
347
347
|
# Define shared examples.
|
348
348
|
# --------------------------------------------------------------------------
|
349
|
-
shared_examples
|
350
|
-
it { is_expected.to eq
|
349
|
+
shared_examples "be converted to lower-kebab-case" do
|
350
|
+
it { is_expected.to eq("i-am-jaga-apple") }
|
351
351
|
end
|
352
352
|
# --------------------------------------------------------------------------
|
353
353
|
|
354
|
-
context
|
355
|
-
include_context
|
354
|
+
context "When a string has one word," do
|
355
|
+
include_context "one word"
|
356
356
|
|
357
|
-
it { is_expected.to eq
|
357
|
+
it { is_expected.to eq("string") }
|
358
358
|
end
|
359
359
|
|
360
|
-
context
|
361
|
-
include_context
|
360
|
+
context "When a string lowerCamelCase," do
|
361
|
+
include_context "lowerCamelCase"
|
362
362
|
|
363
|
-
it_behaves_like
|
363
|
+
it_behaves_like "be converted to lower-kebab-case"
|
364
364
|
end
|
365
365
|
|
366
|
-
context
|
367
|
-
include_context
|
366
|
+
context "When a string UpperCamelCase," do
|
367
|
+
include_context "UpperCamelCase"
|
368
368
|
|
369
|
-
it_behaves_like
|
369
|
+
it_behaves_like "be converted to lower-kebab-case"
|
370
370
|
end
|
371
371
|
|
372
|
-
context
|
373
|
-
include_context
|
372
|
+
context "When a string lower_snake_case," do
|
373
|
+
include_context "lower_snake_case"
|
374
374
|
|
375
|
-
it_behaves_like
|
375
|
+
it_behaves_like "be converted to lower-kebab-case"
|
376
376
|
end
|
377
377
|
|
378
|
-
context
|
379
|
-
include_context
|
378
|
+
context "When a string Upper_Snake_Case," do
|
379
|
+
include_context "Upper_Snake_Case"
|
380
380
|
|
381
|
-
it_behaves_like
|
381
|
+
it_behaves_like "be converted to lower-kebab-case"
|
382
382
|
end
|
383
383
|
|
384
|
-
context
|
385
|
-
include_context
|
384
|
+
context "When a string lower-kebab-case," do
|
385
|
+
include_context "lower-kebab-case"
|
386
386
|
|
387
|
-
it_behaves_like
|
387
|
+
it_behaves_like "be converted to lower-kebab-case"
|
388
388
|
end
|
389
389
|
|
390
|
-
context
|
391
|
-
include_context
|
390
|
+
context "When a string Upper-Kebab-Case," do
|
391
|
+
include_context "Upper-Kebab-Case"
|
392
392
|
|
393
|
-
it_behaves_like
|
393
|
+
it_behaves_like "be converted to lower-kebab-case"
|
394
394
|
end
|
395
395
|
|
396
|
-
context
|
397
|
-
include_context
|
396
|
+
context "When a string lower space case," do
|
397
|
+
include_context "lower space case"
|
398
398
|
|
399
|
-
it_behaves_like
|
399
|
+
it_behaves_like "be converted to lower-kebab-case"
|
400
400
|
end
|
401
401
|
|
402
|
-
context
|
403
|
-
include_context
|
402
|
+
context "When a string Upper Space Case," do
|
403
|
+
include_context "Upper Space Case"
|
404
404
|
|
405
|
-
it_behaves_like
|
405
|
+
it_behaves_like "be converted to lower-kebab-case"
|
406
406
|
end
|
407
|
-
context
|
408
|
-
include_context
|
407
|
+
context "When a string lower.dot.case," do
|
408
|
+
include_context "lower.dot.case"
|
409
409
|
|
410
|
-
it_behaves_like
|
410
|
+
it_behaves_like "be converted to lower-kebab-case"
|
411
411
|
end
|
412
412
|
|
413
|
-
context
|
414
|
-
include_context
|
413
|
+
context "When a string Upper.Dot.Case," do
|
414
|
+
include_context "Upper.Dot.Case"
|
415
415
|
|
416
|
-
it_behaves_like
|
416
|
+
it_behaves_like "be converted to lower-kebab-case"
|
417
417
|
end
|
418
418
|
end
|
419
419
|
|
@@ -421,79 +421,79 @@ describe '[ Case Methods ]' do
|
|
421
421
|
# ----------------------------------------------------------------------------
|
422
422
|
# Convert to Upper-Kebab-Case
|
423
423
|
# ----------------------------------------------------------------------------
|
424
|
-
describe
|
424
|
+
describe "CONVERT TO Upper-Kebab-Case ::" do
|
425
425
|
subject { string.to_ukebab }
|
426
426
|
|
427
427
|
# Define shared examples.
|
428
428
|
# --------------------------------------------------------------------------
|
429
|
-
shared_examples
|
430
|
-
it { is_expected.to eq
|
429
|
+
shared_examples "be converted to Upper-Kebab-Case" do
|
430
|
+
it { is_expected.to eq("I-Am-Jaga-Apple") }
|
431
431
|
end
|
432
432
|
# --------------------------------------------------------------------------
|
433
433
|
|
434
|
-
context
|
435
|
-
include_context
|
434
|
+
context "When a string has one word," do
|
435
|
+
include_context "one word"
|
436
436
|
|
437
|
-
it { is_expected.to eq
|
437
|
+
it { is_expected.to eq("String") }
|
438
438
|
end
|
439
439
|
|
440
|
-
context
|
441
|
-
include_context
|
440
|
+
context "When a string lowerCamelCase," do
|
441
|
+
include_context "lowerCamelCase"
|
442
442
|
|
443
|
-
it_behaves_like
|
443
|
+
it_behaves_like "be converted to Upper-Kebab-Case"
|
444
444
|
end
|
445
445
|
|
446
|
-
context
|
447
|
-
include_context
|
446
|
+
context "When a string UpperCamelCase," do
|
447
|
+
include_context "UpperCamelCase"
|
448
448
|
|
449
|
-
it_behaves_like
|
449
|
+
it_behaves_like "be converted to Upper-Kebab-Case"
|
450
450
|
end
|
451
451
|
|
452
|
-
context
|
453
|
-
include_context
|
452
|
+
context "When a string lower_snake_case," do
|
453
|
+
include_context "lower_snake_case"
|
454
454
|
|
455
|
-
it_behaves_like
|
455
|
+
it_behaves_like "be converted to Upper-Kebab-Case"
|
456
456
|
end
|
457
457
|
|
458
|
-
context
|
459
|
-
include_context
|
458
|
+
context "When a string Upper_Snake_Case," do
|
459
|
+
include_context "Upper_Snake_Case"
|
460
460
|
|
461
|
-
it_behaves_like
|
461
|
+
it_behaves_like "be converted to Upper-Kebab-Case"
|
462
462
|
end
|
463
463
|
|
464
|
-
context
|
465
|
-
include_context
|
464
|
+
context "When a string lower-kebab-case," do
|
465
|
+
include_context "lower-kebab-case"
|
466
466
|
|
467
|
-
it_behaves_like
|
467
|
+
it_behaves_like "be converted to Upper-Kebab-Case"
|
468
468
|
end
|
469
469
|
|
470
|
-
context
|
471
|
-
include_context
|
470
|
+
context "When a string Upper-Kebab-Case," do
|
471
|
+
include_context "Upper-Kebab-Case"
|
472
472
|
|
473
|
-
it_behaves_like
|
473
|
+
it_behaves_like "be converted to Upper-Kebab-Case"
|
474
474
|
end
|
475
475
|
|
476
|
-
context
|
477
|
-
include_context
|
476
|
+
context "When a string lower space case," do
|
477
|
+
include_context "lower space case"
|
478
478
|
|
479
|
-
it_behaves_like
|
479
|
+
it_behaves_like "be converted to Upper-Kebab-Case"
|
480
480
|
end
|
481
481
|
|
482
|
-
context
|
483
|
-
include_context
|
482
|
+
context "When a string Upper Space Case," do
|
483
|
+
include_context "Upper Space Case"
|
484
484
|
|
485
|
-
it_behaves_like
|
485
|
+
it_behaves_like "be converted to Upper-Kebab-Case"
|
486
486
|
end
|
487
|
-
context
|
488
|
-
include_context
|
487
|
+
context "When a string lower.dot.case," do
|
488
|
+
include_context "lower.dot.case"
|
489
489
|
|
490
|
-
it_behaves_like
|
490
|
+
it_behaves_like "be converted to Upper-Kebab-Case"
|
491
491
|
end
|
492
492
|
|
493
|
-
context
|
494
|
-
include_context
|
493
|
+
context "When a string Upper.Dot.Case," do
|
494
|
+
include_context "Upper.Dot.Case"
|
495
495
|
|
496
|
-
it_behaves_like
|
496
|
+
it_behaves_like "be converted to Upper-Kebab-Case"
|
497
497
|
end
|
498
498
|
end
|
499
499
|
|
@@ -501,79 +501,79 @@ describe '[ Case Methods ]' do
|
|
501
501
|
# ----------------------------------------------------------------------------
|
502
502
|
# Convert to lower space case
|
503
503
|
# ----------------------------------------------------------------------------
|
504
|
-
describe
|
504
|
+
describe "CONVERT TO lower space case ::" do
|
505
505
|
subject { string.to_lspace }
|
506
506
|
|
507
507
|
# Define shared examples.
|
508
508
|
# --------------------------------------------------------------------------
|
509
|
-
shared_examples
|
510
|
-
it { is_expected.to eq
|
509
|
+
shared_examples "be converted to lower space case" do
|
510
|
+
it { is_expected.to eq("i am jaga apple") }
|
511
511
|
end
|
512
512
|
# --------------------------------------------------------------------------
|
513
513
|
|
514
|
-
context
|
515
|
-
include_context
|
514
|
+
context "When a string has one word," do
|
515
|
+
include_context "one word"
|
516
516
|
|
517
|
-
it { is_expected.to eq
|
517
|
+
it { is_expected.to eq("string") }
|
518
518
|
end
|
519
519
|
|
520
|
-
context
|
521
|
-
include_context
|
520
|
+
context "When a string lowerCamelCase," do
|
521
|
+
include_context "lowerCamelCase"
|
522
522
|
|
523
|
-
it_behaves_like
|
523
|
+
it_behaves_like "be converted to lower space case"
|
524
524
|
end
|
525
525
|
|
526
|
-
context
|
527
|
-
include_context
|
526
|
+
context "When a string UpperCamelCase," do
|
527
|
+
include_context "UpperCamelCase"
|
528
528
|
|
529
|
-
it_behaves_like
|
529
|
+
it_behaves_like "be converted to lower space case"
|
530
530
|
end
|
531
531
|
|
532
|
-
context
|
533
|
-
include_context
|
532
|
+
context "When a string lower_snake_case," do
|
533
|
+
include_context "lower_snake_case"
|
534
534
|
|
535
|
-
it_behaves_like
|
535
|
+
it_behaves_like "be converted to lower space case"
|
536
536
|
end
|
537
537
|
|
538
|
-
context
|
539
|
-
include_context
|
538
|
+
context "When a string Upper_Snake_Case," do
|
539
|
+
include_context "Upper_Snake_Case"
|
540
540
|
|
541
|
-
it_behaves_like
|
541
|
+
it_behaves_like "be converted to lower space case"
|
542
542
|
end
|
543
543
|
|
544
|
-
context
|
545
|
-
include_context
|
544
|
+
context "When a string lower-kebab-case," do
|
545
|
+
include_context "lower-kebab-case"
|
546
546
|
|
547
|
-
it_behaves_like
|
547
|
+
it_behaves_like "be converted to lower space case"
|
548
548
|
end
|
549
549
|
|
550
|
-
context
|
551
|
-
include_context
|
550
|
+
context "When a string Upper-Kebab-Case," do
|
551
|
+
include_context "Upper-Kebab-Case"
|
552
552
|
|
553
|
-
it_behaves_like
|
553
|
+
it_behaves_like "be converted to lower space case"
|
554
554
|
end
|
555
555
|
|
556
|
-
context
|
557
|
-
include_context
|
556
|
+
context "When a string lower space case," do
|
557
|
+
include_context "lower space case"
|
558
558
|
|
559
|
-
it_behaves_like
|
559
|
+
it_behaves_like "be converted to lower space case"
|
560
560
|
end
|
561
561
|
|
562
|
-
context
|
563
|
-
include_context
|
562
|
+
context "When a string Upper Space Case," do
|
563
|
+
include_context "Upper Space Case"
|
564
564
|
|
565
|
-
it_behaves_like
|
565
|
+
it_behaves_like "be converted to lower space case"
|
566
566
|
end
|
567
|
-
context
|
568
|
-
include_context
|
567
|
+
context "When a string lower.dot.case," do
|
568
|
+
include_context "lower.dot.case"
|
569
569
|
|
570
|
-
it_behaves_like
|
570
|
+
it_behaves_like "be converted to lower space case"
|
571
571
|
end
|
572
572
|
|
573
|
-
context
|
574
|
-
include_context
|
573
|
+
context "When a string Upper.Dot.Case," do
|
574
|
+
include_context "Upper.Dot.Case"
|
575
575
|
|
576
|
-
it_behaves_like
|
576
|
+
it_behaves_like "be converted to lower space case"
|
577
577
|
end
|
578
578
|
end
|
579
579
|
|
@@ -581,79 +581,79 @@ describe '[ Case Methods ]' do
|
|
581
581
|
# ----------------------------------------------------------------------------
|
582
582
|
# Convert to Upper Space Case
|
583
583
|
# ----------------------------------------------------------------------------
|
584
|
-
describe
|
584
|
+
describe "CONVERT TO Upper Space Case ::" do
|
585
585
|
subject { string.to_uspace }
|
586
586
|
|
587
587
|
# Define shared examples.
|
588
588
|
# --------------------------------------------------------------------------
|
589
|
-
shared_examples
|
590
|
-
it { is_expected.to eq
|
589
|
+
shared_examples "be converted to Upper Space Case" do
|
590
|
+
it { is_expected.to eq("I Am Jaga Apple") }
|
591
591
|
end
|
592
592
|
# --------------------------------------------------------------------------
|
593
593
|
|
594
|
-
context
|
595
|
-
include_context
|
594
|
+
context "When a string has one word," do
|
595
|
+
include_context "one word"
|
596
596
|
|
597
|
-
it { is_expected.to eq
|
597
|
+
it { is_expected.to eq("String") }
|
598
598
|
end
|
599
599
|
|
600
|
-
context
|
601
|
-
include_context
|
600
|
+
context "When a string lowerCamelCase," do
|
601
|
+
include_context "lowerCamelCase"
|
602
602
|
|
603
|
-
it_behaves_like
|
603
|
+
it_behaves_like "be converted to Upper Space Case"
|
604
604
|
end
|
605
605
|
|
606
|
-
context
|
607
|
-
include_context
|
606
|
+
context "When a string UpperCamelCase," do
|
607
|
+
include_context "UpperCamelCase"
|
608
608
|
|
609
|
-
it_behaves_like
|
609
|
+
it_behaves_like "be converted to Upper Space Case"
|
610
610
|
end
|
611
611
|
|
612
|
-
context
|
613
|
-
include_context
|
612
|
+
context "When a string lower_snake_case," do
|
613
|
+
include_context "lower_snake_case"
|
614
614
|
|
615
|
-
it_behaves_like
|
615
|
+
it_behaves_like "be converted to Upper Space Case"
|
616
616
|
end
|
617
617
|
|
618
|
-
context
|
619
|
-
include_context
|
618
|
+
context "When a string Upper_Snake_Case," do
|
619
|
+
include_context "Upper_Snake_Case"
|
620
620
|
|
621
|
-
it_behaves_like
|
621
|
+
it_behaves_like "be converted to Upper Space Case"
|
622
622
|
end
|
623
623
|
|
624
|
-
context
|
625
|
-
include_context
|
624
|
+
context "When a string lower-kebab-case," do
|
625
|
+
include_context "lower-kebab-case"
|
626
626
|
|
627
|
-
it_behaves_like
|
627
|
+
it_behaves_like "be converted to Upper Space Case"
|
628
628
|
end
|
629
629
|
|
630
|
-
context
|
631
|
-
include_context
|
630
|
+
context "When a string Upper-Kebab-Case," do
|
631
|
+
include_context "Upper-Kebab-Case"
|
632
632
|
|
633
|
-
it_behaves_like
|
633
|
+
it_behaves_like "be converted to Upper Space Case"
|
634
634
|
end
|
635
635
|
|
636
|
-
context
|
637
|
-
include_context
|
636
|
+
context "When a string lower space case," do
|
637
|
+
include_context "lower space case"
|
638
638
|
|
639
|
-
it_behaves_like
|
639
|
+
it_behaves_like "be converted to Upper Space Case"
|
640
640
|
end
|
641
641
|
|
642
|
-
context
|
643
|
-
include_context
|
642
|
+
context "When a string Upper Space Case," do
|
643
|
+
include_context "Upper Space Case"
|
644
644
|
|
645
|
-
it_behaves_like
|
645
|
+
it_behaves_like "be converted to Upper Space Case"
|
646
646
|
end
|
647
|
-
context
|
648
|
-
include_context
|
647
|
+
context "When a string lower.dot.case," do
|
648
|
+
include_context "lower.dot.case"
|
649
649
|
|
650
|
-
it_behaves_like
|
650
|
+
it_behaves_like "be converted to Upper Space Case"
|
651
651
|
end
|
652
652
|
|
653
|
-
context
|
654
|
-
include_context
|
653
|
+
context "When a string Upper.Dot.Case," do
|
654
|
+
include_context "Upper.Dot.Case"
|
655
655
|
|
656
|
-
it_behaves_like
|
656
|
+
it_behaves_like "be converted to Upper Space Case"
|
657
657
|
end
|
658
658
|
end
|
659
659
|
|
@@ -661,240 +661,205 @@ describe '[ Case Methods ]' do
|
|
661
661
|
# ----------------------------------------------------------------------------
|
662
662
|
# Convert to lower.dot.case
|
663
663
|
# ----------------------------------------------------------------------------
|
664
|
-
describe
|
664
|
+
describe "CONVERT TO lower.dot.case ::" do
|
665
665
|
subject { string.to_ldot }
|
666
666
|
|
667
667
|
# Define shared examples.
|
668
668
|
# --------------------------------------------------------------------------
|
669
|
-
shared_examples
|
670
|
-
it { is_expected.to eq
|
669
|
+
shared_examples "be converted to lower.dot.case" do
|
670
|
+
it { is_expected.to eq("i.am.jaga.apple") }
|
671
671
|
end
|
672
672
|
# --------------------------------------------------------------------------
|
673
673
|
|
674
|
-
context
|
675
|
-
include_context
|
674
|
+
context "When a string has one word," do
|
675
|
+
include_context "one word"
|
676
676
|
|
677
|
-
it { is_expected.to eq
|
677
|
+
it { is_expected.to eq("string") }
|
678
678
|
end
|
679
679
|
|
680
|
-
context
|
681
|
-
include_context
|
680
|
+
context "When a string lowerCamelCase," do
|
681
|
+
include_context "lowerCamelCase"
|
682
682
|
|
683
|
-
it_behaves_like
|
683
|
+
it_behaves_like "be converted to lower.dot.case"
|
684
684
|
end
|
685
685
|
|
686
|
-
context
|
687
|
-
include_context
|
686
|
+
context "When a string UpperCamelCase," do
|
687
|
+
include_context "UpperCamelCase"
|
688
688
|
|
689
|
-
it_behaves_like
|
689
|
+
it_behaves_like "be converted to lower.dot.case"
|
690
690
|
end
|
691
691
|
|
692
|
-
context
|
693
|
-
include_context
|
692
|
+
context "When a string lower_snake_case," do
|
693
|
+
include_context "lower_snake_case"
|
694
694
|
|
695
|
-
it_behaves_like
|
695
|
+
it_behaves_like "be converted to lower.dot.case"
|
696
696
|
end
|
697
697
|
|
698
|
-
context
|
699
|
-
include_context
|
698
|
+
context "When a string Upper_Snake_Case," do
|
699
|
+
include_context "Upper_Snake_Case"
|
700
700
|
|
701
|
-
it_behaves_like
|
701
|
+
it_behaves_like "be converted to lower.dot.case"
|
702
702
|
end
|
703
703
|
|
704
|
-
context
|
705
|
-
include_context
|
704
|
+
context "When a string lower-kebab-case," do
|
705
|
+
include_context "lower-kebab-case"
|
706
706
|
|
707
|
-
it_behaves_like
|
707
|
+
it_behaves_like "be converted to lower.dot.case"
|
708
708
|
end
|
709
709
|
|
710
|
-
context
|
711
|
-
include_context
|
710
|
+
context "When a string Upper-Kebab-Case," do
|
711
|
+
include_context "Upper-Kebab-Case"
|
712
712
|
|
713
|
-
it_behaves_like
|
713
|
+
it_behaves_like "be converted to lower.dot.case"
|
714
714
|
end
|
715
715
|
|
716
|
-
context
|
717
|
-
include_context
|
716
|
+
context "When a string lower space case," do
|
717
|
+
include_context "lower space case"
|
718
718
|
|
719
|
-
it_behaves_like
|
719
|
+
it_behaves_like "be converted to lower.dot.case"
|
720
720
|
end
|
721
721
|
|
722
|
-
context
|
723
|
-
include_context
|
722
|
+
context "When a string Upper Space Case," do
|
723
|
+
include_context "Upper Space Case"
|
724
724
|
|
725
|
-
it_behaves_like
|
725
|
+
it_behaves_like "be converted to lower.dot.case"
|
726
726
|
end
|
727
|
-
context
|
728
|
-
include_context
|
727
|
+
context "When a string lower.dot.case," do
|
728
|
+
include_context "lower.dot.case"
|
729
729
|
|
730
|
-
it_behaves_like
|
730
|
+
it_behaves_like "be converted to lower.dot.case"
|
731
731
|
end
|
732
732
|
|
733
|
-
context
|
734
|
-
include_context
|
733
|
+
context "When a string Upper.Dot.Case," do
|
734
|
+
include_context "Upper.Dot.Case"
|
735
735
|
|
736
|
-
it_behaves_like
|
736
|
+
it_behaves_like "be converted to lower.dot.case"
|
737
737
|
end
|
738
738
|
end
|
739
739
|
|
740
740
|
|
741
|
+
# ----------------------------------------------------------------------------
|
742
|
+
# Private
|
743
|
+
# ----------------------------------------------------------------------------
|
741
744
|
# ----------------------------------------------------------------------------
|
742
745
|
# Convert to Upper.Dot.Case
|
743
746
|
# ----------------------------------------------------------------------------
|
744
|
-
describe
|
747
|
+
describe "CONVERT TO Upper.Dot.Case ::" do
|
745
748
|
subject { string.to_udot }
|
746
749
|
|
747
750
|
# Define shared examples.
|
748
751
|
# --------------------------------------------------------------------------
|
749
|
-
shared_examples
|
750
|
-
it { is_expected.to eq
|
752
|
+
shared_examples "be converted to Upper.Dot.Case" do
|
753
|
+
it { is_expected.to eq("I.Am.Jaga.Apple") }
|
751
754
|
end
|
752
755
|
# --------------------------------------------------------------------------
|
753
756
|
|
754
|
-
context
|
755
|
-
include_context
|
757
|
+
context "When a string has one word," do
|
758
|
+
include_context "one word"
|
756
759
|
|
757
|
-
it { is_expected.to eq
|
760
|
+
it { is_expected.to eq("String") }
|
758
761
|
end
|
759
762
|
|
760
|
-
context
|
761
|
-
include_context
|
763
|
+
context "When a string lowerCamelCase," do
|
764
|
+
include_context "lowerCamelCase"
|
762
765
|
|
763
|
-
it_behaves_like
|
766
|
+
it_behaves_like "be converted to Upper.Dot.Case"
|
764
767
|
end
|
765
768
|
|
766
|
-
context
|
767
|
-
include_context
|
769
|
+
context "When a string UpperCamelCase," do
|
770
|
+
include_context "UpperCamelCase"
|
768
771
|
|
769
|
-
it_behaves_like
|
772
|
+
it_behaves_like "be converted to Upper.Dot.Case"
|
770
773
|
end
|
771
774
|
|
772
|
-
context
|
773
|
-
include_context
|
775
|
+
context "When a string lower_snake_case," do
|
776
|
+
include_context "lower_snake_case"
|
774
777
|
|
775
|
-
it_behaves_like
|
778
|
+
it_behaves_like "be converted to Upper.Dot.Case"
|
776
779
|
end
|
777
780
|
|
778
|
-
context
|
779
|
-
include_context
|
781
|
+
context "When a string Upper_Snake_Case," do
|
782
|
+
include_context "Upper_Snake_Case"
|
780
783
|
|
781
|
-
it_behaves_like
|
784
|
+
it_behaves_like "be converted to Upper.Dot.Case"
|
782
785
|
end
|
783
786
|
|
784
|
-
context
|
785
|
-
include_context
|
787
|
+
context "When a string lower-kebab-case," do
|
788
|
+
include_context "lower-kebab-case"
|
786
789
|
|
787
|
-
it_behaves_like
|
790
|
+
it_behaves_like "be converted to Upper.Dot.Case"
|
788
791
|
end
|
789
792
|
|
790
|
-
context
|
791
|
-
include_context
|
793
|
+
context "When a string Upper-Kebab-Case," do
|
794
|
+
include_context "Upper-Kebab-Case"
|
792
795
|
|
793
|
-
it_behaves_like
|
796
|
+
it_behaves_like "be converted to Upper.Dot.Case"
|
794
797
|
end
|
795
798
|
|
796
|
-
context
|
797
|
-
include_context
|
799
|
+
context "When a string lower space case," do
|
800
|
+
include_context "lower space case"
|
798
801
|
|
799
|
-
it_behaves_like
|
802
|
+
it_behaves_like "be converted to Upper.Dot.Case"
|
800
803
|
end
|
801
804
|
|
802
|
-
context
|
803
|
-
include_context
|
805
|
+
context "When a string Upper Space Case," do
|
806
|
+
include_context "Upper Space Case"
|
804
807
|
|
805
|
-
it_behaves_like
|
808
|
+
it_behaves_like "be converted to Upper.Dot.Case"
|
806
809
|
end
|
807
|
-
context
|
808
|
-
include_context
|
810
|
+
context "When a string lower.dot.case," do
|
811
|
+
include_context "lower.dot.case"
|
809
812
|
|
810
|
-
it_behaves_like
|
813
|
+
it_behaves_like "be converted to Upper.Dot.Case"
|
811
814
|
end
|
812
815
|
|
813
|
-
context
|
814
|
-
include_context
|
816
|
+
context "When a string Upper.Dot.Case," do
|
817
|
+
include_context "Upper.Dot.Case"
|
815
818
|
|
816
|
-
it_behaves_like
|
819
|
+
it_behaves_like "be converted to Upper.Dot.Case"
|
817
820
|
end
|
818
821
|
end
|
819
822
|
|
820
823
|
|
821
824
|
# ----------------------------------------------------------------------------
|
822
|
-
# Split
|
825
|
+
# Split String According to Camel Case
|
823
826
|
# ----------------------------------------------------------------------------
|
824
|
-
describe
|
827
|
+
describe "SPLIT ACCORDING TO CAMEL CASE ::" do
|
825
828
|
let(:string) { nil }
|
826
|
-
subject { string.split_camel }
|
829
|
+
subject { string.instance_eval { split_camel } }
|
827
830
|
|
828
|
-
context
|
829
|
-
let!(:string) {
|
830
|
-
it { is_expected.to eq
|
831
|
-
end
|
832
|
-
|
833
|
-
context 'When string is Lower Camel Case,' do
|
834
|
-
let!(:string) { 'thisIsWord' }
|
835
|
-
it { is_expected.to eq ['this', 'Is', 'Word'] }
|
831
|
+
context "When string is Upper Camel Case," do
|
832
|
+
let!(:string) { "ThisIsWord" }
|
833
|
+
it { is_expected.to eq(["This", "Is", "Word"]) }
|
836
834
|
end
|
837
835
|
|
838
|
-
context
|
839
|
-
let!(:string) {
|
840
|
-
it { is_expected.to eq
|
841
|
-
end
|
842
|
-
end
|
843
|
-
|
844
|
-
|
845
|
-
# ----------------------------------------------------------------------------
|
846
|
-
# Check is_upper?
|
847
|
-
# ----------------------------------------------------------------------------
|
848
|
-
describe 'CHECK is_upper?' do
|
849
|
-
let(:character) { nil }
|
850
|
-
subject { character.is_upper? }
|
851
|
-
|
852
|
-
context 'when a character is upper case,' do
|
853
|
-
let(:character) { 'C' }
|
854
|
-
it { is_expected.to eq true }
|
855
|
-
end
|
856
|
-
|
857
|
-
context 'when a character is lower case,' do
|
858
|
-
let(:character) { 'c' }
|
859
|
-
it { is_expected.to eq false }
|
860
|
-
end
|
861
|
-
end
|
862
|
-
|
863
|
-
|
864
|
-
# ----------------------------------------------------------------------------
|
865
|
-
# Check is_lower?
|
866
|
-
# ----------------------------------------------------------------------------
|
867
|
-
describe 'CHECK is_lower?' do
|
868
|
-
let(:character) { nil }
|
869
|
-
subject { character.is_lower? }
|
870
|
-
|
871
|
-
context 'when a character is lower case,' do
|
872
|
-
let(:character) { 'c' }
|
873
|
-
it { is_expected.to eq true }
|
836
|
+
context "When string is Lower Camel Case," do
|
837
|
+
let!(:string) { "thisIsWord" }
|
838
|
+
it { is_expected.to eq(["this", "Is", "Word"]) }
|
874
839
|
end
|
875
840
|
|
876
|
-
context
|
877
|
-
let(:
|
878
|
-
it { is_expected.to eq
|
841
|
+
context "When string is not Camel Case," do
|
842
|
+
let!(:string) { "thisisword" }
|
843
|
+
it { is_expected.to eq(["thisisword"]) }
|
879
844
|
end
|
880
845
|
end
|
881
846
|
|
882
847
|
|
883
848
|
# ----------------------------------------------------------------------------
|
884
|
-
# Make
|
849
|
+
# Make First Character Lower Case
|
885
850
|
# ----------------------------------------------------------------------------
|
886
|
-
describe
|
851
|
+
describe "MAKE FIRST CHARACTER LOWER CASE ::" do
|
887
852
|
let(:string) { nil }
|
888
|
-
subject { string.make_head_lower }
|
853
|
+
subject { string.instance_eval { make_head_lower } }
|
889
854
|
|
890
|
-
context
|
891
|
-
let(:string) {
|
892
|
-
it { is_expected.to eq
|
855
|
+
context "When first character is Upper Case," do
|
856
|
+
let(:string) { "ThisIsString" }
|
857
|
+
it { is_expected.to eq("thisIsString") }
|
893
858
|
end
|
894
859
|
|
895
|
-
context
|
896
|
-
let(:string) {
|
897
|
-
it { is_expected.to eq
|
860
|
+
context "When first character is Lower Case," do
|
861
|
+
let(:string) { "thisIsString" }
|
862
|
+
it { is_expected.to eq("thisIsString") }
|
898
863
|
end
|
899
864
|
end
|
900
865
|
|