chars 0.2.0 → 0.2.4
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.
- checksums.yaml +7 -0
- data/.document +1 -1
- data/.gemspec +0 -0
- data/.github/workflows/ruby.yml +28 -0
- data/.gitignore +8 -0
- data/.yardopts +1 -1
- data/ChangeLog.md +30 -0
- data/Gemfile +12 -0
- data/LICENSE.txt +1 -1
- data/README.md +79 -46
- data/Rakefile +7 -30
- data/benchmarks/compare.rb +16 -0
- data/benchmarks/strings_in.rb +23 -0
- data/chars.gemspec +58 -7
- data/gemspec.yml +10 -4
- data/lib/chars/char_set.rb +193 -94
- data/lib/chars/chars.rb +78 -38
- data/lib/chars/extensions/integer.rb +51 -34
- data/lib/chars/extensions/string.rb +34 -17
- data/lib/chars/version.rb +2 -2
- data/spec/char_set_spec.rb +236 -133
- data/spec/chars_spec.rb +14 -73
- data/spec/{integer_spec.rb → extensions/integer_spec.rb} +19 -20
- data/spec/{string_spec.rb → extensions/string_spec.rb} +20 -19
- data/spec/spec_helper.rb +0 -1
- metadata +56 -98
data/spec/char_set_spec.rb
CHANGED
@@ -1,220 +1,323 @@
|
|
1
|
-
require 'chars/chars'
|
2
|
-
|
3
1
|
require 'spec_helper'
|
2
|
+
require 'chars/char_set'
|
4
3
|
|
5
4
|
describe Chars::CharSet do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
@strings = @string_range.to_a
|
5
|
+
let(:integer_range) { (0x41..0x43) }
|
6
|
+
let(:string_range) { ('A'..'Z') }
|
7
|
+
let(:integers) { integer_range.to_a }
|
8
|
+
let(:strings) { string_range.to_a }
|
11
9
|
|
12
|
-
|
13
|
-
end
|
10
|
+
subject { described_class.new(*strings) }
|
14
11
|
|
15
|
-
|
16
|
-
|
12
|
+
describe "#initialize" do
|
13
|
+
context "when given multiple String arguments" do
|
14
|
+
subject { described_class.new(*strings) }
|
17
15
|
|
18
|
-
|
19
|
-
|
16
|
+
it "must populate the char set with the String's chars" do
|
17
|
+
expect(strings.all? { |s| subject.include_char?(s) }).to be(true)
|
18
|
+
end
|
20
19
|
end
|
21
|
-
end
|
22
20
|
|
23
|
-
|
24
|
-
|
21
|
+
context "when given an Array of Strings" do
|
22
|
+
subject { described_class.new(strings) }
|
25
23
|
|
26
|
-
|
27
|
-
|
24
|
+
it "must populate the char set with the String's chars" do
|
25
|
+
expect(strings.all? { |s| subject.include_char?(s) }).to be(true)
|
26
|
+
end
|
28
27
|
end
|
29
|
-
end
|
30
28
|
|
31
|
-
|
32
|
-
|
29
|
+
context "when given a Range of Strings" do
|
30
|
+
subject { described_class.new(string_range) }
|
33
31
|
|
34
|
-
|
35
|
-
|
32
|
+
it "must populate the char set by enumerating over the String's chars" do
|
33
|
+
expect(strings.all? { |s| subject.include_char?(s) }).to be(true)
|
34
|
+
end
|
36
35
|
end
|
37
|
-
end
|
38
36
|
|
39
|
-
|
40
|
-
|
37
|
+
context "when given multiple Integer arguments" do
|
38
|
+
subject { described_class.new(*integers) }
|
41
39
|
|
42
|
-
|
43
|
-
|
40
|
+
it "must populate the char set using the Integers as bytes" do
|
41
|
+
expect(integers.all? { |i| subject.include?(i) }).to be(true)
|
42
|
+
end
|
44
43
|
end
|
45
|
-
end
|
46
44
|
|
47
|
-
|
48
|
-
|
45
|
+
context "when given an Array of Integers" do
|
46
|
+
subject { described_class.new(integers) }
|
49
47
|
|
50
|
-
|
51
|
-
|
48
|
+
it "must populate the char set using the Integers as bytes" do
|
49
|
+
expect(integers.all? { |i| subject.include?(i) }).to be(true)
|
50
|
+
end
|
52
51
|
end
|
53
|
-
end
|
54
52
|
|
55
|
-
|
56
|
-
|
53
|
+
context "when given a Range of Integers" do
|
54
|
+
subject { described_class.new(integer_range) }
|
57
55
|
|
58
|
-
|
59
|
-
|
56
|
+
it "must populate the char set by enumerating over the Integer's bytes" do
|
57
|
+
expect(integers.all? { |i| subject.include?(i) }).to be(true)
|
58
|
+
end
|
60
59
|
end
|
61
60
|
end
|
62
61
|
|
63
|
-
|
64
|
-
|
62
|
+
describe "#include_char?" do
|
63
|
+
it "should include Strings" do
|
64
|
+
expect(subject.include_char?('A')).to be(true)
|
65
|
+
end
|
65
66
|
end
|
66
67
|
|
67
|
-
|
68
|
-
|
68
|
+
describe "#include?" do
|
69
|
+
it "should include Integers" do
|
70
|
+
expect(subject).to include(0x41)
|
71
|
+
end
|
69
72
|
end
|
70
73
|
|
71
|
-
|
72
|
-
|
74
|
+
describe "#select_bytes" do
|
75
|
+
it "should be able to select bytes" do
|
76
|
+
sub_set = subject.select_bytes { |c| c <= 0x42 }
|
73
77
|
|
74
|
-
|
78
|
+
expect(sub_set).to be == [0x41, 0x42]
|
79
|
+
end
|
75
80
|
end
|
76
81
|
|
77
|
-
|
78
|
-
|
82
|
+
describe "#select_chars" do
|
83
|
+
it "should be able to select chars" do
|
84
|
+
sub_set = subject.select_chars { |c| c <= 'B' }
|
79
85
|
|
80
|
-
|
86
|
+
expect(sub_set).to be == ['A', 'B']
|
87
|
+
end
|
81
88
|
end
|
82
89
|
|
83
|
-
|
84
|
-
|
90
|
+
describe "#random_byte" do
|
91
|
+
it "should return a random byte" do
|
92
|
+
expect(subject).to include(subject.random_byte)
|
93
|
+
end
|
85
94
|
end
|
86
95
|
|
87
|
-
|
88
|
-
|
96
|
+
describe "#random_char" do
|
97
|
+
it "should return a random char" do
|
98
|
+
expect(subject.include_char?(subject.random_char)).to be(true)
|
99
|
+
end
|
89
100
|
end
|
90
101
|
|
91
|
-
|
92
|
-
|
93
|
-
|
102
|
+
describe "#each_random_byte" do
|
103
|
+
it "should iterate over n random bytes" do
|
104
|
+
expect(subject.each_random_byte(10).all? { |b|
|
105
|
+
subject.include?(b)
|
106
|
+
}).to be(true)
|
94
107
|
end
|
95
108
|
end
|
96
109
|
|
97
|
-
|
98
|
-
|
99
|
-
|
110
|
+
describe "#each_random_char" do
|
111
|
+
it "should iterate over n random chars" do
|
112
|
+
expect(subject.each_random_char(10).all? { |c|
|
113
|
+
subject.include_char?(c)
|
114
|
+
}).to be(true)
|
100
115
|
end
|
101
116
|
end
|
102
117
|
|
103
|
-
|
104
|
-
bytes
|
118
|
+
describe "#random_bytes" do
|
119
|
+
it "should return a random Array of bytes" do
|
120
|
+
random_bytes = subject.random_bytes(10)
|
105
121
|
|
106
|
-
|
107
|
-
@char_set.include?(b).should == true
|
122
|
+
expect(random_bytes.all? { |b| subject.include?(b) }).to be(true)
|
108
123
|
end
|
109
|
-
end
|
110
124
|
|
111
|
-
|
112
|
-
|
125
|
+
context "with a range of lengths" do
|
126
|
+
it "should return a random Array of bytes with a varying length" do
|
127
|
+
random_bytes = subject.random_bytes(5..10)
|
113
128
|
|
114
|
-
|
115
|
-
|
129
|
+
expect(random_bytes.length).to be_between(5, 10)
|
130
|
+
expect(random_bytes.all? { |b| subject.include?(b) }).to be(true)
|
131
|
+
end
|
116
132
|
end
|
117
133
|
end
|
118
134
|
|
119
|
-
|
120
|
-
|
135
|
+
describe "#random_chars" do
|
136
|
+
it "should return a random Array of chars" do
|
137
|
+
random_chars = subject.random_chars(10)
|
121
138
|
|
122
|
-
|
123
|
-
bytes.each do |b|
|
124
|
-
@char_set.include?(b).should == true
|
139
|
+
expect(random_chars.all? { |c| subject.include_char?(c) }).to be(true)
|
125
140
|
end
|
126
|
-
end
|
127
141
|
|
128
|
-
|
129
|
-
|
142
|
+
context "with a range of lengths" do
|
143
|
+
it "should return a random Array of chars with a varying length" do
|
144
|
+
random_chars = subject.random_chars(5..10)
|
130
145
|
|
131
|
-
|
132
|
-
|
133
|
-
|
146
|
+
expect(random_chars.length).to be_between(5, 10)
|
147
|
+
expect(random_chars.all? { |c| subject.include_char?(c) }).to be(true)
|
148
|
+
end
|
134
149
|
end
|
135
150
|
end
|
136
151
|
|
137
|
-
|
138
|
-
|
139
|
-
|
152
|
+
describe "#random_string" do
|
153
|
+
it "should return a random String of chars" do
|
154
|
+
random_string = subject.random_string(10)
|
155
|
+
|
156
|
+
expect(random_string.chars.all? { |b|
|
157
|
+
subject.include_char?(b)
|
158
|
+
}).to be(true)
|
140
159
|
end
|
141
|
-
end
|
142
160
|
|
143
|
-
|
144
|
-
|
161
|
+
context "with a range of lengths" do
|
162
|
+
it "should return a random String of chars with a varying length" do
|
163
|
+
random_string = subject.random_string(5..10)
|
145
164
|
|
146
|
-
|
147
|
-
|
148
|
-
|
165
|
+
expect(random_string.length).to be_between(5, 10)
|
166
|
+
expect(random_string.chars.all? { |b|
|
167
|
+
subject.include_char?(b)
|
168
|
+
}).to be(true)
|
169
|
+
end
|
149
170
|
end
|
150
171
|
end
|
151
172
|
|
152
|
-
|
153
|
-
bytes
|
154
|
-
|
155
|
-
|
156
|
-
|
173
|
+
describe "#random_distinct_bytes" do
|
174
|
+
it "should return a random Array of unique bytes" do
|
175
|
+
random_bytes = subject.random_distinct_bytes(10)
|
176
|
+
|
177
|
+
expect(random_bytes.uniq).to be == random_bytes
|
178
|
+
expect(random_bytes.all? { |b| subject.include_byte?(b) }).to be(true)
|
157
179
|
end
|
158
|
-
end
|
159
180
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
181
|
+
context "with a Range of lengths" do
|
182
|
+
it "should return a random Array of unique bytes with a varying length" do
|
183
|
+
random_bytes = subject.random_distinct_bytes(5..10)
|
184
|
+
|
185
|
+
expect(random_bytes.uniq).to be == random_bytes
|
186
|
+
expect(random_bytes.length).to be_between(5, 10)
|
187
|
+
expect(random_bytes.all? { |b| subject.include_byte?(b) }).to be(true)
|
188
|
+
end
|
165
189
|
end
|
166
190
|
end
|
167
191
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
192
|
+
describe "#random_distinct_chars" do
|
193
|
+
it "should return a random Array of unique chars" do
|
194
|
+
random_chars = subject.random_distinct_chars(10)
|
195
|
+
|
196
|
+
expect(random_chars.uniq).to be == random_chars
|
197
|
+
expect(random_chars.all? { |c| subject.include_char?(c) }).to be(true)
|
174
198
|
end
|
175
|
-
end
|
176
199
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
200
|
+
context "with a range of lengths" do
|
201
|
+
it "should return a random Array of unique chars with a varying length" do
|
202
|
+
random_chars = subject.random_distinct_chars(5..10)
|
203
|
+
|
204
|
+
expect(random_chars.uniq).to be == random_chars
|
205
|
+
expect(random_chars.length).to be_between(5, 10)
|
206
|
+
expect(random_chars.all? { |c| subject.include_char?(c) }).to be(true)
|
207
|
+
end
|
183
208
|
end
|
184
209
|
end
|
185
210
|
|
186
|
-
|
187
|
-
|
188
|
-
|
211
|
+
describe "#==" do
|
212
|
+
it "should be able to be compared with another set of chars" do
|
213
|
+
expect(subject).to be == described_class['A'..'Z']
|
214
|
+
end
|
189
215
|
end
|
190
216
|
|
191
|
-
|
192
|
-
|
217
|
+
describe "#|" do
|
218
|
+
it "should be able to be unioned with another set of chars" do
|
219
|
+
super_set = (subject | described_class['D'])
|
193
220
|
|
194
|
-
|
195
|
-
|
221
|
+
expect(super_set).to be_kind_of(described_class)
|
222
|
+
expect(super_set).to be == described_class['A'..'Z', 'D']
|
223
|
+
end
|
196
224
|
end
|
197
225
|
|
198
|
-
|
199
|
-
|
226
|
+
describe "#-" do
|
227
|
+
it "should be able to be removed from another set of chars" do
|
228
|
+
sub_set = (subject - described_class['B'])
|
200
229
|
|
201
|
-
|
202
|
-
|
230
|
+
expect(sub_set).to be_kind_of(described_class)
|
231
|
+
expect(sub_set).to be_subset(subject)
|
232
|
+
end
|
203
233
|
end
|
204
234
|
|
205
|
-
|
206
|
-
|
207
|
-
|
235
|
+
describe "#strings_in" do
|
236
|
+
subject { described_class.new(['A', 'B', 'C']) }
|
237
|
+
|
238
|
+
let(:string) { "AAAA....BBBB....CCCC...." }
|
239
|
+
|
240
|
+
context "when given a block" do
|
241
|
+
it "should find sub-strings from a String belonging to the char set" do
|
242
|
+
expect { |b|
|
243
|
+
subject.strings_in(string,&b)
|
244
|
+
}.to yield_successive_args(
|
245
|
+
"AAAA",
|
246
|
+
"BBBB",
|
247
|
+
"CCCC"
|
248
|
+
)
|
249
|
+
end
|
250
|
+
|
251
|
+
it "must find sub-strings of a minimum length of 4" do
|
252
|
+
expect { |b|
|
253
|
+
subject.strings_in("A...BBB...CCCC",&b)
|
254
|
+
}.to yield_successive_args("CCCC")
|
255
|
+
end
|
256
|
+
|
257
|
+
context "and when the whole string matches the char set" do
|
258
|
+
it "should find one sub-string from a String belonging to the char set" do
|
259
|
+
expect { |b|
|
260
|
+
subject.strings_in("AAAA",&b)
|
261
|
+
}.to yield_successive_args("AAAA")
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
context "when the :length option is given" do
|
266
|
+
it "must find sub-strings of the given minimum length" do
|
267
|
+
expect { |b|
|
268
|
+
subject.strings_in("AAAA...BBBB...CCCCC", :length => 5, &b)
|
269
|
+
}.to yield_successive_args("CCCCC")
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
context "and when the block takes two arguments" do
|
274
|
+
it "must yield the sub-strings and their indexes" do
|
275
|
+
yielded_args = []
|
276
|
+
|
277
|
+
subject.strings_in(string) do |substring,index|
|
278
|
+
yielded_args << [substring, index]
|
279
|
+
end
|
280
|
+
|
281
|
+
expect(yielded_args).to eq(
|
282
|
+
[
|
283
|
+
['AAAA', string.index('AAAA')],
|
284
|
+
['BBBB', string.index('BBBB')],
|
285
|
+
['CCCC', string.index('CCCC')]
|
286
|
+
]
|
287
|
+
)
|
288
|
+
end
|
289
|
+
end
|
290
|
+
end
|
208
291
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
292
|
+
context "when no block is given" do
|
293
|
+
it "must return an Array of sub-strings" do
|
294
|
+
expect(subject.strings_in(string)).to eq(
|
295
|
+
[
|
296
|
+
"AAAA",
|
297
|
+
"BBBB",
|
298
|
+
"CCCC"
|
299
|
+
]
|
300
|
+
)
|
301
|
+
end
|
302
|
+
|
303
|
+
context "when given the :offset option" do
|
304
|
+
it "must return a Hash of the substrings and their indexes" do
|
305
|
+
expect(subject.strings_in(string, :offsets => true)).to eq(
|
306
|
+
{
|
307
|
+
"AAAA" => string.index("AAAA"),
|
308
|
+
"BBBB" => string.index("BBBB"),
|
309
|
+
"CCCC" => string.index("CCCC")
|
310
|
+
}
|
311
|
+
)
|
312
|
+
end
|
313
|
+
end
|
314
|
+
end
|
214
315
|
end
|
215
316
|
|
216
|
-
|
217
|
-
|
218
|
-
|
317
|
+
describe "#===" do
|
318
|
+
it "should determine if a String is made up of the characters from the char set" do
|
319
|
+
expect(subject).to be === "AABCBAA"
|
320
|
+
expect(subject).to_not be === "AA!!EE"
|
321
|
+
end
|
219
322
|
end
|
220
323
|
end
|
data/spec/chars_spec.rb
CHANGED
@@ -1,115 +1,56 @@
|
|
1
|
-
require 'chars/chars'
|
2
|
-
|
3
1
|
require 'spec_helper'
|
2
|
+
require 'chars/chars'
|
4
3
|
|
5
4
|
describe Chars do
|
6
|
-
before(:all) do
|
7
|
-
@numeric_string = Chars.numeric.random_string(10)
|
8
|
-
@octal_string = Chars.octal.random_string(10)
|
9
|
-
@uppercase_hex_string = Chars.uppercase_hexadecimal.random_string(10)
|
10
|
-
@lowercase_hex_string = Chars.lowercase_hexadecimal.random_string(10)
|
11
|
-
@hex_string = Chars.hexadecimal.random_string(10)
|
12
|
-
@uppercase_alpha_string = Chars.uppercase_alpha.random_string(10)
|
13
|
-
@lowercase_alpha_string = Chars.lowercase_alpha.random_string(10)
|
14
|
-
@alpha_string = Chars.alpha.random_string(10)
|
15
|
-
@alpha_numeric_string = Chars.alpha_numeric.random_string(10)
|
16
|
-
@space_string = Chars.space.random_string(10)
|
17
|
-
@punctuation_string = Chars.punctuation.random_string(10)
|
18
|
-
@symbols_string = Chars.symbols.random_string(10)
|
19
|
-
@control_string = Chars.control.random_string(10)
|
20
|
-
@signed_ascii_string = Chars.signed_ascii.random_string(10)
|
21
|
-
@ascii_string = Chars.ascii.random_string(10)
|
22
|
-
@visible_string = Chars.visible.random_string(10)
|
23
|
-
end
|
24
|
-
|
25
5
|
it "should provide a numeric CharSet" do
|
26
|
-
|
27
|
-
@numeric_string.each_byte do |b|
|
28
|
-
Chars::NUMERIC.include?(b).should == true
|
29
|
-
end
|
6
|
+
expect(described_class::NUMERIC).to be =~ '0123456789'
|
30
7
|
end
|
31
8
|
|
32
9
|
it "should provide an octal CharSet" do
|
33
|
-
|
34
|
-
@octal_string.each_byte do |b|
|
35
|
-
Chars::OCTAL.include?(b).should == true
|
36
|
-
end
|
10
|
+
expect(described_class::OCTAL).to be =~ "01234567"
|
37
11
|
end
|
38
12
|
|
39
13
|
it "should provide an upper-case hexadecimal CharSet" do
|
40
|
-
|
41
|
-
@uppercase_hex_string.each_byte do |b|
|
42
|
-
Chars::UPPERCASE_HEXADECIMAL.include?(b).should == true
|
43
|
-
end
|
14
|
+
expect(described_class::UPPERCASE_HEXADECIMAL).to be =~ "0123456789ABCDEF"
|
44
15
|
end
|
45
16
|
|
46
17
|
it "should provide a lower-case hexadecimal CharSet" do
|
47
|
-
|
48
|
-
@lowercase_hex_string.each_byte do |b|
|
49
|
-
Chars::LOWERCASE_HEXADECIMAL.include?(b).should == true
|
50
|
-
end
|
18
|
+
expect(described_class::LOWERCASE_HEXADECIMAL).to be =~ "0123456789abcdef"
|
51
19
|
end
|
52
20
|
|
53
21
|
it "should provide a hexadecimal CharSet" do
|
54
|
-
|
55
|
-
@hex_string.each_byte do |b|
|
56
|
-
Chars::HEXADECIMAL.include?(b).should == true
|
57
|
-
end
|
22
|
+
expect(described_class::HEXADECIMAL).to be =~ "0123456789ABCDEFabcdef"
|
58
23
|
end
|
59
24
|
|
60
25
|
it "should provide an upper-case alpha CharSet" do
|
61
|
-
|
62
|
-
@uppercase_alpha_string.each_byte do |b|
|
63
|
-
Chars::UPPERCASE_ALPHA.include?(b).should == true
|
64
|
-
end
|
26
|
+
expect(described_class::UPPERCASE_ALPHA).to be =~ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
65
27
|
end
|
66
28
|
|
67
29
|
it "should provide a lower-case alpha CharSet" do
|
68
|
-
|
69
|
-
@lowercase_alpha_string.each_byte do |b|
|
70
|
-
Chars::LOWERCASE_ALPHA.include?(b).should == true
|
71
|
-
end
|
30
|
+
expect(described_class::LOWERCASE_ALPHA).to be =~ "abcdefghijklmnopqrstuvwxyz"
|
72
31
|
end
|
73
32
|
|
74
33
|
it "should provide an alpha CharSet" do
|
75
|
-
|
76
|
-
@alpha_string.each_byte do |b|
|
77
|
-
Chars::ALPHA.include?(b).should == true
|
78
|
-
end
|
34
|
+
expect(described_class::ALPHA).to be =~ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
|
79
35
|
end
|
80
36
|
|
81
37
|
it "should provide an alpha-numeric CharSet" do
|
82
|
-
|
83
|
-
@alpha_numeric_string.each_byte do |b|
|
84
|
-
Chars::ALPHA_NUMERIC.include?(b).should == true
|
85
|
-
end
|
38
|
+
expect(described_class::ALPHA_NUMERIC).to be =~ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
86
39
|
end
|
87
40
|
|
88
41
|
it "should provide a visible CharSet" do
|
89
|
-
|
90
|
-
@visible_string.each_byte do |b|
|
91
|
-
Chars::VISIBLE.include?(b).should == true
|
92
|
-
end
|
42
|
+
expect(described_class::VISIBLE).to be =~ "!\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
|
93
43
|
end
|
94
44
|
|
95
45
|
it "should provide a space CharSet" do
|
96
|
-
|
97
|
-
@space_string.each_byte do |b|
|
98
|
-
Chars::SPACE.include?(b).should == true
|
99
|
-
end
|
46
|
+
expect(described_class::SPACE).to be =~ "\t\n\v\f\r "
|
100
47
|
end
|
101
48
|
|
102
49
|
it "should provide a punctuation CharSet" do
|
103
|
-
|
104
|
-
@punctuation_string.each_byte do |b|
|
105
|
-
Chars::PUNCTUATION.include?(b).should == true
|
106
|
-
end
|
50
|
+
expect(described_class::PUNCTUATION).to be =~ " !\"'(),-.:;?[]`{}~"
|
107
51
|
end
|
108
52
|
|
109
53
|
it "should provide a symbols CharSet" do
|
110
|
-
|
111
|
-
@symbols_string.each_byte do |b|
|
112
|
-
Chars::SYMBOLS.include?(b).should == true
|
113
|
-
end
|
54
|
+
expect(described_class::SYMBOLS).to be =~ " !\"\#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
|
114
55
|
end
|
115
56
|
end
|