kanrisuru 0.8.16 → 0.8.17
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/CHANGELOG.md +5 -1
- data/lib/kanrisuru/core/disk.rb +1 -1
- data/lib/kanrisuru/core/transfer.rb +12 -1
- data/lib/kanrisuru/version.rb +1 -1
- data/spec/functional/core/path_spec.rb +1 -2
- data/spec/functional/core/stat_spec.rb +4 -7
- data/spec/functional/core/stream_spec.rb +25 -26
- data/spec/functional/core/transfer_spec.rb +181 -0
- data/spec/helper/expect_helpers.rb +2 -1
- data/spec/helper/stub_network.rb +8 -10
- data/spec/integration/core/disk_spec.rb +1 -1
- data/spec/integration/core/file_spec.rb +8 -5
- data/spec/spec_helper.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fddbe577acc9083ead480c1c69dad8e74c3b00c6a66cd770655b626bf022cb7
|
4
|
+
data.tar.gz: dac3e1bfc3ddcb59eff30b620e080210f23e0a2586ab0b38031db01920504c90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43537168eee374dbe372259ea263a139dd9999ad242666e1f036adecee96df6d1040e1a03cc083ca9e1ba6704c61d29c6146e97356951564927278f61e14762a
|
7
|
+
data.tar.gz: 45184c4eeafd9447b4e46f323a65d545f666eaeac33bd3e1e19f1d308fc1555ff6042850eecad47368ce5927fa8065b55e6cb141ca09731b3dd190f79fe0134a
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
## Kanrisuru 0.8.
|
1
|
+
## Kanrisuru 0.8.17 (October 16 2021)
|
2
|
+
* Add functional test cases for `transfer` module
|
3
|
+
* Update wget command to accept hash for `headers` opt.
|
4
|
+
|
5
|
+
## Kanrisuru 0.8.16 (October 14, 2021)
|
2
6
|
* Add functional test cases for `stream` and `path` modules
|
3
7
|
* Create `expect_command` helper for quick testing on raw command result
|
4
8
|
|
data/lib/kanrisuru/core/disk.rb
CHANGED
@@ -23,7 +23,7 @@ module Kanrisuru
|
|
23
23
|
:name, :label, :uuid, :type, :uuid_sub, :label_fatboot, :version, :usage,
|
24
24
|
:part_uuid, :part_entry_scheme, :part_entry_uuid, :part_entry_type,
|
25
25
|
:part_entry_number, :part_entry_offset, :part_entry_size, :part_entry_disk,
|
26
|
-
:minimum_io_size, :physical_sector_size, :logical_sector_size
|
26
|
+
:minimum_io_size, :physical_sector_size, :logical_sector_size
|
27
27
|
)
|
28
28
|
|
29
29
|
def du(opts = {})
|
@@ -124,7 +124,6 @@ module Kanrisuru
|
|
124
124
|
command.append_flag('--no-cookies', opts[:no_cookies])
|
125
125
|
command.append_flag('--keep-session-cookies', opts[:keep_session_cookies])
|
126
126
|
command.append_flag('--ignore-length', opts[:ignore_length])
|
127
|
-
command.append_arg('--header', opts[:header])
|
128
127
|
command.append_arg('--max-redirect', opts[:max_redirect])
|
129
128
|
command.append_arg('--proxy-user', opts[:proxy_user])
|
130
129
|
command.append_arg('--proxy-password', opts[:proxy_password])
|
@@ -132,6 +131,18 @@ module Kanrisuru
|
|
132
131
|
command.append_flag('--save-headers', opts[:save_headers])
|
133
132
|
command.append_arg('--user-agent', opts[:user_agent])
|
134
133
|
|
134
|
+
headers = opts[:headers]
|
135
|
+
if Kanrisuru::Util.present?(headers)
|
136
|
+
if headers.instance_of?(Hash)
|
137
|
+
headers.each do |key, value|
|
138
|
+
header = "'#{key}: #{value}'"
|
139
|
+
command.append_arg('--header', header)
|
140
|
+
end
|
141
|
+
elsif headers.instance_of?(String)
|
142
|
+
command.append_arg('--header', headers)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
135
146
|
post_data = opts[:post_data]
|
136
147
|
|
137
148
|
if Kanrisuru::Util.present?(post_data)
|
data/lib/kanrisuru/version.rb
CHANGED
@@ -8,7 +8,7 @@ RSpec.describe Kanrisuru::Core::Path do
|
|
8
8
|
let(:host) do
|
9
9
|
Kanrisuru::Remote::Host.new(
|
10
10
|
host: 'localhost',
|
11
|
-
username: 'ubuntu',
|
11
|
+
username: 'ubuntu',
|
12
12
|
keys: ['id_rsa']
|
13
13
|
)
|
14
14
|
end
|
@@ -42,5 +42,4 @@ RSpec.describe Kanrisuru::Core::Path do
|
|
42
42
|
expect_command(host.readlink('/etc/os-release', canonicalize_existing: true), 'readlink -e /etc/os-release')
|
43
43
|
expect_command(host.readlink('/etc/os-release', canonicalize_missing: true), 'readlink -m /etc/os-release')
|
44
44
|
end
|
45
|
-
|
46
45
|
end
|
@@ -8,19 +8,16 @@ RSpec.describe Kanrisuru::Core::Stat do
|
|
8
8
|
let(:host) do
|
9
9
|
Kanrisuru::Remote::Host.new(
|
10
10
|
host: 'localhost',
|
11
|
-
username: 'ubuntu',
|
11
|
+
username: 'ubuntu',
|
12
12
|
keys: ['id_rsa']
|
13
13
|
)
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'prepares stat command' do
|
17
|
-
expect_command(host.stat('~/file1.txt'),
|
18
|
-
|
19
|
-
)
|
17
|
+
expect_command(host.stat('~/file1.txt'),
|
18
|
+
'stat -c %A,%b,%D,%F,%g,%G,%h,%i,%n,%s,%u,%U,%x,%y,%z ~/file1.txt')
|
20
19
|
|
21
20
|
expect_command(host.stat('~/file2.txt', follow: true),
|
22
|
-
|
23
|
-
)
|
21
|
+
'stat -L -c %A,%b,%D,%F,%g,%G,%h,%i,%n,%s,%u,%U,%x,%y,%z ~/file2.txt')
|
24
22
|
end
|
25
|
-
|
26
23
|
end
|
@@ -8,7 +8,7 @@ RSpec.describe Kanrisuru::Core::Stream do
|
|
8
8
|
let(:host) do
|
9
9
|
Kanrisuru::Remote::Host.new(
|
10
10
|
host: 'localhost',
|
11
|
-
username: 'ubuntu',
|
11
|
+
username: 'ubuntu',
|
12
12
|
keys: ['id_rsa']
|
13
13
|
)
|
14
14
|
end
|
@@ -26,13 +26,13 @@ RSpec.describe Kanrisuru::Core::Stream do
|
|
26
26
|
|
27
27
|
it 'prepares tail command' do
|
28
28
|
result = host.tail('/var/log/syslog')
|
29
|
-
expect_command(result, 'tail /var/log/syslog'
|
29
|
+
expect_command(result, 'tail /var/log/syslog')
|
30
30
|
|
31
31
|
result = host.tail('/var/log/syslog', bytes: 1024)
|
32
32
|
expect_command(result, 'tail -c 1024 /var/log/syslog')
|
33
33
|
|
34
34
|
result = host.tail('/var/log/syslog', lines: 50)
|
35
|
-
expect_command(result, 'tail -n 50 /var/log/syslog'
|
35
|
+
expect_command(result, 'tail -n 50 /var/log/syslog')
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'prepares read_file_chunk command' do
|
@@ -42,59 +42,59 @@ RSpec.describe Kanrisuru::Core::Stream do
|
|
42
42
|
result = host.read_file_chunk('/var/log/apache2/access.log', 0, 0)
|
43
43
|
expect_command(result, 'tail -n +0 /var/log/apache2/access.log | head -n 1')
|
44
44
|
|
45
|
-
expect
|
45
|
+
expect do
|
46
46
|
host.read_file_chunk('file.log', 10, '20')
|
47
|
-
|
47
|
+
end.to raise_error(ArgumentError)
|
48
48
|
|
49
|
-
expect
|
49
|
+
expect do
|
50
50
|
host.read_file_chunk('file.log', '10', 20)
|
51
|
-
|
51
|
+
end.to raise_error(ArgumentError)
|
52
52
|
|
53
|
-
expect
|
53
|
+
expect do
|
54
54
|
host.read_file_chunk('file.log', 10, 9)
|
55
|
-
|
55
|
+
end.to raise_error(ArgumentError)
|
56
56
|
|
57
|
-
expect
|
57
|
+
expect do
|
58
58
|
host.read_file_chunk('file.log', -1, 1)
|
59
|
-
|
59
|
+
end.to raise_error(ArgumentError)
|
60
60
|
|
61
|
-
expect
|
61
|
+
expect do
|
62
62
|
host.read_file_chunk('file.log', 10, -2)
|
63
|
-
|
63
|
+
end.to raise_error(ArgumentError)
|
64
64
|
end
|
65
65
|
|
66
66
|
it 'prepares sed command' do
|
67
|
-
result = host.sed(
|
67
|
+
result = host.sed('~/file.txt', 'Cat', 'Dog')
|
68
68
|
expect_command(result, "sed 's/Cat/Dog/g' '~/file.txt'")
|
69
69
|
|
70
|
-
result = host.sed(
|
70
|
+
result = host.sed('~/file.txt', 'Cat', 'Doggz', in_place: true, new_file: '~/file2.txt', mode: 'write')
|
71
71
|
expect_command(result, "sed -i 's/Cat/Doggz/g' '~/file.txt' > ~/file2.txt")
|
72
72
|
|
73
|
-
result = host.sed(
|
73
|
+
result = host.sed('~/file.txt', 'Cat', 'Dogo', regexp_extended: true, new_file: '~/file2.txt', mode: 'append')
|
74
74
|
expect_command(result, "sed -r 's/Cat/Dogo/g' '~/file.txt' >> ~/file2.txt")
|
75
75
|
end
|
76
76
|
|
77
77
|
it 'prepares echo command' do
|
78
|
-
expect_command(host.echo('Hello world')
|
79
|
-
expect_command(host.echo(
|
78
|
+
expect_command(host.echo('Hello world'), "echo 'Hello world'")
|
79
|
+
expect_command(host.echo('Hello\\n world', backslash: true), "echo -e 'Hello\\n world'")
|
80
80
|
|
81
81
|
expect_command(host.echo('Hello world', new_file: '~/file1.txt', mode: 'write'),
|
82
82
|
"echo 'Hello world' > ~/file1.txt")
|
83
|
-
|
83
|
+
|
84
|
+
expect_command(host.echo('Goodbye', new_file: '~/file1.txt', mode: 'append'),
|
84
85
|
"echo 'Goodbye' >> ~/file1.txt")
|
85
86
|
end
|
86
87
|
|
87
88
|
it 'prepares cat command' do
|
88
89
|
expect_command(host.cat('/etc/group'), 'cat /etc/group')
|
89
90
|
expect_command(host.cat('/etc/group', show_all: true), 'cat -A /etc/group')
|
90
|
-
expect_command(host.cat('/etc/group',
|
91
|
-
show_tabs: true,
|
92
|
-
number: true,
|
93
|
-
squeeze_blank: true,
|
91
|
+
expect_command(host.cat('/etc/group',
|
92
|
+
show_tabs: true,
|
93
|
+
number: true,
|
94
|
+
squeeze_blank: true,
|
94
95
|
show_nonprinting: true,
|
95
96
|
show_ends: true,
|
96
|
-
number_nonblank: true
|
97
|
-
), 'cat -T -n -s -v -E -b /etc/group')
|
97
|
+
number_nonblank: true), 'cat -T -n -s -v -E -b /etc/group')
|
98
98
|
|
99
99
|
expect_command(host.cat(['~/file1.txt', '~/file2.txt', '~/file3.txt']),
|
100
100
|
'cat ~/file1.txt ~/file2.txt ~/file3.txt')
|
@@ -105,5 +105,4 @@ RSpec.describe Kanrisuru::Core::Stream do
|
|
105
105
|
expect_command(host.cat(['~/file1.txt', '~/file2.txt', '~/file3.txt'], mode: 'append', new_file: 'combined.txt'),
|
106
106
|
'cat ~/file1.txt ~/file2.txt ~/file3.txt >> combined.txt')
|
107
107
|
end
|
108
|
-
|
109
108
|
end
|
@@ -0,0 +1,181 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
StubNetwork.stub!
|
6
|
+
|
7
|
+
RSpec.describe Kanrisuru::Core::Stat do
|
8
|
+
let(:host) do
|
9
|
+
Kanrisuru::Remote::Host.new(
|
10
|
+
host: 'localhost',
|
11
|
+
username: 'ubuntu',
|
12
|
+
keys: ['id_rsa']
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'prepares wget command' do
|
17
|
+
url = 'https://rubygems.org'
|
18
|
+
|
19
|
+
expect_command(host.wget(url),
|
20
|
+
"wget #{url}"
|
21
|
+
)
|
22
|
+
|
23
|
+
## Output options
|
24
|
+
expect_command(host.wget(url,
|
25
|
+
quiet: true, verbose: false, log_file: '/var/log/wget.log'),
|
26
|
+
"wget --quiet --no-verbose --output-file /var/log/wget.log #{url}"
|
27
|
+
)
|
28
|
+
|
29
|
+
expect_command(host.wget(url,
|
30
|
+
verbose: true, append_log_file: '/var/log/wget.log'),
|
31
|
+
"wget --verbose --append-output /var/log/wget.log #{url}"
|
32
|
+
)
|
33
|
+
|
34
|
+
## Download options
|
35
|
+
expect_command(host.wget(url,
|
36
|
+
bind_address: '0.0.0.0',
|
37
|
+
retries: 3,
|
38
|
+
output_document: '/home/ubuntu/index.html',
|
39
|
+
no_clobber: true,
|
40
|
+
timeout: 30,
|
41
|
+
dns_timeout: 60,
|
42
|
+
connect_timeout: 60,
|
43
|
+
read_timeout: 15,
|
44
|
+
limit_rate: '120k',
|
45
|
+
wait: 5,
|
46
|
+
waitretry: 15,
|
47
|
+
random_wait: true,
|
48
|
+
no_proxy: true,
|
49
|
+
no_dns_cache: true
|
50
|
+
),
|
51
|
+
"wget --bind-address 0.0.0.0 --tries 3 --output-document /home/ubuntu/index.html --no-clobber --timeout 30 --dns-timeout 60 --connect-timeout 60 --read-timeout 15 --limit-rate 120k --wait 5 --waitretry 15 --random-wait --no-proxy --no-dns-cache https://rubygems.org"
|
52
|
+
)
|
53
|
+
|
54
|
+
## Other Options
|
55
|
+
expect_command(host.wget(url,
|
56
|
+
quota: 'inf',
|
57
|
+
family: 'inet',
|
58
|
+
restrict_file_names: ['unix', 'ascii', 'lowercase', 'uppercase'],
|
59
|
+
retry_connrefused: true,
|
60
|
+
user: 'admin',
|
61
|
+
password: 'admin',
|
62
|
+
no_iri: true,
|
63
|
+
),
|
64
|
+
"wget --quota inf --restrict-file-names unix,ascii,lowercase,uppercase --inet4-only --retry-connrefused --user admin --password admin --no-iri #{url}"
|
65
|
+
)
|
66
|
+
|
67
|
+
## Directories
|
68
|
+
expect_command(host.wget(url,
|
69
|
+
no_directories: true,
|
70
|
+
no_host_directories: true,
|
71
|
+
cut_dirs: 3,
|
72
|
+
directory_prefix: '~/downloads/'
|
73
|
+
),
|
74
|
+
"wget --no-directories --no-host-directories --cut-dirs 3 --directory-prefix ~/downloads/ #{url}"
|
75
|
+
)
|
76
|
+
|
77
|
+
## HTTP
|
78
|
+
expect_command(host.wget(url,
|
79
|
+
default_page: 'index.html',
|
80
|
+
adjust_extension: true,
|
81
|
+
http_user: 'admin',
|
82
|
+
http_password: 'admin',
|
83
|
+
load_cookies: '~/cookies.txt',
|
84
|
+
save_cookies: '~/cookies.txt',
|
85
|
+
no_cache: true,
|
86
|
+
keep_session_cookies: true,
|
87
|
+
ignore_length: true,
|
88
|
+
headers: {
|
89
|
+
'Accept-Language' => 'hr',
|
90
|
+
'Authorization' => 'Bearer 1234'
|
91
|
+
},
|
92
|
+
max_redirect: 5,
|
93
|
+
proxy_user: 'admin',
|
94
|
+
proxy_password: '12345678'
|
95
|
+
),
|
96
|
+
"wget --default-page index.html --adjust-extension --http-user admin --http-password admin --load-cookies ~/cookies.txt --save-cookies ~/cookies.txt --no-cache --keep-session-cookies --ignore-length --max-redirect 5 --proxy-user admin --proxy-password 12345678 --header 'Accept-Language: hr' --header 'Authorization: Bearer 1234' #{url}"
|
97
|
+
)
|
98
|
+
|
99
|
+
expect_command(host.wget(url,
|
100
|
+
post_data: {
|
101
|
+
url: "https://example.com?param=123"
|
102
|
+
},
|
103
|
+
content_disposition: true,
|
104
|
+
secure_protocol: 'SSLv3',
|
105
|
+
no_check_certificate: true,
|
106
|
+
),
|
107
|
+
"wget --post-data url=https%3A%2F%2Fexample.com%3Fparam%3D123 --content-disposition --secure-protocol SSLv3 --no-check-certificate #{url}"
|
108
|
+
)
|
109
|
+
|
110
|
+
expect {
|
111
|
+
host.wget(url, secure_protocol: 'SSL')
|
112
|
+
}.to raise_error(ArgumentError)
|
113
|
+
|
114
|
+
expect_command(host.wget(url,
|
115
|
+
certificate: '~/cert.pem',
|
116
|
+
certificate_type: 'PEM',
|
117
|
+
private_key: '~/key.pem',
|
118
|
+
private_key_type: 'PEM',
|
119
|
+
ca_certificate: '~/ca.pem',
|
120
|
+
random_file: '~/random'
|
121
|
+
),
|
122
|
+
"wget --certificate ~/cert.pem --certificate-type PEM --private-key ~/key.pem --private-key-type PEM --ca-certificate ~/ca.pem --random-file ~/random #{url}"
|
123
|
+
)
|
124
|
+
|
125
|
+
expect_command(host.wget(url,
|
126
|
+
certificate: '~/cert.pem',
|
127
|
+
certificate_type: 'PEM',
|
128
|
+
private_key: '~/key.pem',
|
129
|
+
private_key_type: 'PEM',
|
130
|
+
ca_certificate: '~/ca.pem',
|
131
|
+
random_file: '~/random'
|
132
|
+
),
|
133
|
+
"wget --certificate ~/cert.pem --certificate-type PEM --private-key ~/key.pem --private-key-type PEM --ca-certificate ~/ca.pem --random-file ~/random #{url}"
|
134
|
+
)
|
135
|
+
|
136
|
+
## FTP
|
137
|
+
expect_command(host.wget(url,
|
138
|
+
ftp_user: 'admin',
|
139
|
+
ftp_password: '12345678',
|
140
|
+
no_remove_listing: true,
|
141
|
+
no_glob: true,
|
142
|
+
no_passive_ftp: true,
|
143
|
+
retr_symlinks: true
|
144
|
+
),
|
145
|
+
"wget --ftp-user admin --ftp-password 12345678 --no-remove-listing --no-glob --no-passive-ftp --retr-symlinks #{url}"
|
146
|
+
)
|
147
|
+
|
148
|
+
## Recursive Retrieval
|
149
|
+
expect_command(host.wget(url,
|
150
|
+
recursive: true,
|
151
|
+
depth: 10,
|
152
|
+
delete_after: true,
|
153
|
+
convert_links: true,
|
154
|
+
backup_converted: true,
|
155
|
+
mirror: true,
|
156
|
+
page_requisites: true,
|
157
|
+
strict_comments: true
|
158
|
+
),
|
159
|
+
"wget --recursive --level 10 --delete-after --convert-links --backup-converted --mirror --page-requisites --strict-comments #{url}"
|
160
|
+
)
|
161
|
+
|
162
|
+
## Recursive Accept/Reject
|
163
|
+
expect_command(host.wget(url,
|
164
|
+
accept_list: ['.txt', '.html'],
|
165
|
+
reject_list: ['.csv'],
|
166
|
+
domain_list: ['example.com'],
|
167
|
+
exclude_domain_list: ['hackernews.com'],
|
168
|
+
follow_tags: ['a', 'div', 'span'],
|
169
|
+
ignore_tags: ['area', 'link'],
|
170
|
+
include_directories: ['/gems'],
|
171
|
+
exclude_directories: ['/releases'],
|
172
|
+
follow_ftp: true,
|
173
|
+
ignore_case: true,
|
174
|
+
span_hosts: true,
|
175
|
+
relative: true,
|
176
|
+
no_parent: true
|
177
|
+
),
|
178
|
+
"wget --accept .txt,.html --reject .csv --domains example.com --exclude-domains hackernews.com --follow-tags a,div,span --ignore-tags area,link --include-directories /gems --exclude-directories /releases --follow-ftp --ignore-case --span-hosts --relative --no-parent #{url}"
|
179
|
+
)
|
180
|
+
end
|
181
|
+
end
|
data/spec/helper/stub_network.rb
CHANGED
@@ -2,15 +2,14 @@
|
|
2
2
|
|
3
3
|
class StubNetwork
|
4
4
|
class << self
|
5
|
-
|
6
5
|
def stub!
|
7
|
-
## Stub out the execute_with_retries method to
|
8
|
-
## test functionality of host commands
|
6
|
+
## Stub out the execute_with_retries method to
|
7
|
+
## test functionality of host commands
|
9
8
|
Kanrisuru::Remote::Host.class_eval do
|
10
9
|
private
|
11
10
|
|
12
11
|
def execute_with_retries(command)
|
13
|
-
command.handle_status(0)
|
12
|
+
command.handle_status(0)
|
14
13
|
command.handle_data(nil)
|
15
14
|
|
16
15
|
command
|
@@ -24,22 +23,21 @@ class StubNetwork
|
|
24
23
|
@kernel_name = 'Linux'
|
25
24
|
@kernel_version = '#91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021'
|
26
25
|
@operating_system = 'GNU/Linux'
|
27
|
-
@hardware_platform =
|
28
|
-
@processor =
|
29
|
-
@release =
|
26
|
+
@hardware_platform = 'x86_64'
|
27
|
+
@processor = 'x86_64'
|
28
|
+
@release = 'ubuntu'
|
30
29
|
@version = 20.0
|
31
30
|
end
|
32
31
|
end
|
33
32
|
|
34
33
|
Kanrisuru::Result.class_eval do
|
35
|
-
def initialize(command
|
34
|
+
def initialize(command)
|
36
35
|
@command = command
|
37
36
|
@data = nil
|
38
37
|
|
39
38
|
@error = @command.to_a if @command.failure?
|
40
39
|
end
|
41
40
|
end
|
42
|
-
end
|
43
|
-
|
41
|
+
end
|
44
42
|
end
|
45
43
|
end
|
@@ -41,7 +41,7 @@ RSpec.describe Kanrisuru::Core::Disk do
|
|
41
41
|
:name, :label, :uuid, :type, :uuid_sub, :label_fatboot, :version, :usage,
|
42
42
|
:part_uuid, :part_entry_scheme, :part_entry_uuid, :part_entry_type,
|
43
43
|
:part_entry_number, :part_entry_offset, :part_entry_size, :part_entry_disk,
|
44
|
-
:minimum_io_size, :physical_sector_size, :logical_sector_size
|
44
|
+
:minimum_io_size, :physical_sector_size, :logical_sector_size
|
45
45
|
)
|
46
46
|
end
|
47
47
|
|
@@ -41,7 +41,10 @@ RSpec.describe Kanrisuru::Core::File do
|
|
41
41
|
)
|
42
42
|
|
43
43
|
host.rm("#{host_json['home']}/.kanrisuru_spec_files", force: true, recursive: true)
|
44
|
-
|
44
|
+
if host.dir?("#{host_json['home']}/extract-tar-files")
|
45
|
+
host.rm("#{host_json['home']}/extract-tar-files", force: true,
|
46
|
+
recursive: true)
|
47
|
+
end
|
45
48
|
host.disconnect
|
46
49
|
end
|
47
50
|
|
@@ -68,9 +71,9 @@ RSpec.describe Kanrisuru::Core::File do
|
|
68
71
|
expect(mode.symbolic).to eq('-rwxr--r--')
|
69
72
|
expect(mode.to_i).to eq(0o744)
|
70
73
|
|
71
|
-
expect
|
74
|
+
expect do
|
72
75
|
host.chmod(path, 600)
|
73
|
-
|
76
|
+
end.to raise_error(ArgumentError)
|
74
77
|
end
|
75
78
|
|
76
79
|
it 'changes file owner and group' do
|
@@ -338,7 +341,7 @@ RSpec.describe Kanrisuru::Core::File do
|
|
338
341
|
## Can't delete non empty dir
|
339
342
|
result = host.rmdir("#{spec_dir}/directory")
|
340
343
|
expect(result).to be_failure
|
341
|
-
|
344
|
+
|
342
345
|
result = host.rmdir("#{spec_dir}/directory/3")
|
343
346
|
expect(result).to be_success
|
344
347
|
end
|
@@ -355,7 +358,7 @@ RSpec.describe Kanrisuru::Core::File do
|
|
355
358
|
|
356
359
|
lines = doc.length
|
357
360
|
words = doc.map(&:split).flatten
|
358
|
-
chars = doc.map(&:length).flatten
|
361
|
+
chars = doc.map(&:length).flatten
|
359
362
|
|
360
363
|
expect(result.lines).to eq(doc.length)
|
361
364
|
expect(result.words).to eq(words.length)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kanrisuru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Mammina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- spec/functional/core/path_spec.rb
|
177
177
|
- spec/functional/core/stat_spec.rb
|
178
178
|
- spec/functional/core/stream_spec.rb
|
179
|
+
- spec/functional/core/transfer_spec.rb
|
179
180
|
- spec/functional/os_package_spec.rb
|
180
181
|
- spec/helper/expect_helpers.rb
|
181
182
|
- spec/helper/stub_network.rb
|