fedux_org-stdlib 0.7.18 → 0.7.19
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fedux_org_stdlib/core_ext/array/list.rb +1 -1
- data/lib/fedux_org_stdlib/version.rb +1 -1
- data/spec/core_ext/array/list_spec.rb +18 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9516f8871b827a5de5b69fc4595149163da19a4d
|
4
|
+
data.tar.gz: ccfee460a2303ba9052aafc4378258d307de5c50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4daaf8e7379496dea493224f12491c6898cd53aef9c6b7476dfafc263f15a4ac478ab265681244d2e5b3afa9741826f26d7e6c4aabc2845565d22675a386dec9
|
7
|
+
data.tar.gz: 4d0ce03fbe1e1a0a2b512376dc4a8e69f73b161b39bf584340b7bdacec74b67ae84eaa7e458ea7d9bf78c97ed9a1989a35a641cb8457f4419ce9d8a097affd64
|
data/Gemfile.lock
CHANGED
@@ -5,9 +5,9 @@ require 'fedux_org_stdlib/core_ext/array/list'
|
|
5
5
|
RSpec.describe Array do
|
6
6
|
context '#to_list' do
|
7
7
|
it 'handles single value' do
|
8
|
-
input = %w{
|
8
|
+
input = %w{ test }
|
9
9
|
|
10
|
-
expect(input.to_list).to eq '"
|
10
|
+
expect(input.to_list).to eq '"test"'
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'handles two values' do
|
@@ -17,33 +17,39 @@ RSpec.describe Array do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'converts array to a list of values' do
|
20
|
-
input = %w{
|
20
|
+
input = %w{ test1 test2 test3 }
|
21
21
|
|
22
|
-
expect(input.to_list).to eq '"
|
22
|
+
expect(input.to_list).to eq '"test1", "test2", "test3"'
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'converts array to a list of values' do
|
26
|
+
input = %w{ test1 test2 test3 test4 }
|
27
|
+
|
28
|
+
expect(input.to_list).to eq '"test1", "test2", "test3", "test4"'
|
23
29
|
end
|
24
30
|
|
25
31
|
it 'supports to change the last separator' do
|
26
|
-
input = %w{
|
32
|
+
input = %w{ test1 test2 test3}
|
27
33
|
|
28
|
-
expect(input.to_list(last_separator: ' or ')).to eq '"
|
34
|
+
expect(input.to_list(last_separator: ' or ')).to eq '"test1", "test2" or "test3"'
|
29
35
|
end
|
30
36
|
|
31
37
|
it 'supports to change the separator' do
|
32
|
-
input = %w{
|
38
|
+
input = %w{ test1 test2 test3}
|
33
39
|
|
34
|
-
expect(input.to_list(separator: ':')).to eq '"
|
40
|
+
expect(input.to_list(separator: ':')).to eq '"test1":"test2":"test3"'
|
35
41
|
end
|
36
42
|
|
37
43
|
it 'change multiple things' do
|
38
|
-
input = %w{
|
44
|
+
input = %w{ test1 test2 test3}
|
39
45
|
|
40
|
-
expect(input.to_list(around: '', separator: ':')).to eq '
|
46
|
+
expect(input.to_list(around: '', separator: ':')).to eq 'test1:test2:test3'
|
41
47
|
end
|
42
48
|
|
43
49
|
it 'supports to change the string to surround items' do
|
44
|
-
input = %w{
|
50
|
+
input = %w{ test1 test2 test3}
|
45
51
|
|
46
|
-
expect(input.to_list(around: '$')).to eq '$
|
52
|
+
expect(input.to_list(around: '$')).to eq '$test1$, $test2$, $test3$'
|
47
53
|
end
|
48
54
|
end
|
49
55
|
end
|