Skip to content

Commit e5b9276

Browse files
author
David Swan
committed
RubocopDay3.5TestCommit
1 parent e24acfe commit e5b9276

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+505
-502
lines changed

spec/acceptance/pw_hash_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/env ruby -S rspec
1+
#! /usr/bin/env ruby -S rspec # rubocop:disable Lint/ScriptPermission
22
require 'spec_helper_acceptance'
33

44
# Windows and OS X do not have useful implementations of crypt(3)

spec/acceptance/range_spec.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@
33

44
describe 'range function' do
55
describe 'success' do
6-
it 'ranges letters' do
7-
pp = <<-EOS
6+
pp1 = <<-EOS
87
$o = range('a','d')
98
notice(inline_template('range is <%= @o.inspect %>'))
10-
EOS
11-
12-
apply_manifest(pp, catch_failures: true) do |r|
9+
EOS
10+
it 'ranges letters' do
11+
apply_manifest(pp1, catch_failures: true) do |r|
1312
expect(r.stdout).to match(%r{range is \["a", "b", "c", "d"\]})
1413
end
1514
end
16-
it 'ranges letters with a step' do
17-
pp = <<-EOS
15+
16+
pp2 = <<-EOS
1817
$o = range('a','d', '2')
1918
notice(inline_template('range is <%= @o.inspect %>'))
20-
EOS
21-
22-
apply_manifest(pp, catch_failures: true) do |r|
19+
EOS
20+
it 'ranges letters with a step' do
21+
apply_manifest(pp2, catch_failures: true) do |r|
2322
expect(r.stdout).to match(%r{range is \["a", "c"\]})
2423
end
2524
end

spec/acceptance/reject_spec.rb

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,32 @@
33

44
describe 'reject function' do
55
describe 'success' do
6-
it 'rejects array of values' do
7-
pp = <<-EOS
6+
pp1 = <<-EOS
87
$o = reject(['aaa','bbb','ccc','aaaddd'], 'aaa')
98
notice(inline_template('reject is <%= @o.inspect %>'))
10-
EOS
11-
12-
apply_manifest(pp, catch_failures: true) do |r|
9+
EOS
10+
it 'rejects array of values' do
11+
apply_manifest(pp1, catch_failures: true) do |r|
1312
expect(r.stdout).to match(%r{reject is \["bbb", "ccc"\]})
1413
end
1514
end
16-
it 'rejects with empty array' do
17-
pp = <<-EOS
15+
16+
pp2 = <<-EOS
1817
$o = reject([],'aaa')
1918
notice(inline_template('reject is <%= @o.inspect %>'))
20-
EOS
21-
22-
apply_manifest(pp, catch_failures: true) do |r|
19+
EOS
20+
it 'rejects with empty array' do
21+
apply_manifest(pp2, catch_failures: true) do |r|
2322
expect(r.stdout).to match(%r{reject is \[\]})
2423
end
2524
end
26-
it 'rejects array of values with undef' do
27-
pp = <<-EOS
25+
26+
pp3 = <<-EOS
2827
$o = reject(['aaa','bbb','ccc','aaaddd'], undef)
2928
notice(inline_template('reject is <%= @o.inspect %>'))
30-
EOS
31-
32-
apply_manifest(pp, catch_failures: true) do |r|
29+
EOS
30+
it 'rejects array of values with undef' do
31+
apply_manifest(pp3, catch_failures: true) do |r|
3332
expect(r.stdout).to match(%r{reject is \[\]})
3433
end
3534
end

spec/acceptance/reverse_spec.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33

44
describe 'reverse function' do
55
describe 'success' do
6-
it 'reverses strings' do
7-
pp = <<-EOS
6+
pp1 = <<-EOS
87
$a = "the public art galleries"
98
# Anagram: Large picture halls, I bet
109
$o = reverse($a)
1110
notice(inline_template('reverse is <%= @o.inspect %>'))
12-
EOS
13-
14-
apply_manifest(pp, catch_failures: true) do |r|
11+
EOS
12+
it 'reverses strings' do
13+
apply_manifest(pp1, catch_failures: true) do |r|
1514
expect(r.stdout).to match(%r{reverse is "seirellag tra cilbup eht"})
1615
end
1716
end

spec/acceptance/rstrip_spec.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,25 @@
33

44
describe 'rstrip function' do
55
describe 'success' do
6-
it 'rstrips arrays' do
7-
pp = <<-EOS
6+
pp1 = <<-EOS
87
$a = [" the "," public "," art","galleries "]
98
# Anagram: Large picture halls, I bet
109
$o = rstrip($a)
1110
notice(inline_template('rstrip is <%= @o.inspect %>'))
12-
EOS
13-
14-
apply_manifest(pp, catch_failures: true) do |r|
11+
EOS
12+
it 'rstrips arrays' do
13+
apply_manifest(pp1, catch_failures: true) do |r|
1514
expect(r.stdout).to match(%r{rstrip is \[" the", " public", " art", "galleries"\]})
1615
end
1716
end
18-
it 'rstrips strings' do
19-
pp = <<-EOS
17+
18+
pp2 = <<-EOS
2019
$a = " blowzy night-frumps vex'd jack q "
2120
$o = rstrip($a)
2221
notice(inline_template('rstrip is <%= @o.inspect %>'))
23-
EOS
24-
25-
apply_manifest(pp, catch_failures: true) do |r|
22+
EOS
23+
it 'rstrips strings' do
24+
apply_manifest(pp2, catch_failures: true) do |r|
2625
expect(r.stdout).to match(%r{rstrip is " blowzy night-frumps vex'd jack q"})
2726
end
2827
end

spec/acceptance/shuffle_spec.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,25 @@
33

44
describe 'shuffle function' do
55
describe 'success' do
6-
it 'shuffles arrays' do
7-
pp = <<-EOS
6+
pp1 = <<-EOS
87
$a = ["1", "2", "3", "4", "5", "6", "7", "8", "the","public","art","galleries"]
98
# Anagram: Large picture halls, I bet
109
$o = shuffle($a)
1110
notice(inline_template('shuffle is <%= @o.inspect %>'))
12-
EOS
13-
14-
apply_manifest(pp, catch_failures: true) do |r|
11+
EOS
12+
it 'shuffles arrays' do
13+
apply_manifest(pp1, catch_failures: true) do |r|
1514
expect(r.stdout).not_to match(%r{shuffle is \["1", "2", "3", "4", "5", "6", "7", "8", "the", "public", "art", "galleries"\]})
1615
end
1716
end
18-
it 'shuffles strings' do
19-
pp = <<-EOS
17+
18+
pp2 = <<-EOS
2019
$a = "blowzy night-frumps vex'd jack q"
2120
$o = shuffle($a)
2221
notice(inline_template('shuffle is <%= @o.inspect %>'))
23-
EOS
24-
25-
apply_manifest(pp, catch_failures: true) do |r|
22+
EOS
23+
it 'shuffles strings' do
24+
apply_manifest(pp2, catch_failures: true) do |r|
2625
expect(r.stdout).not_to match(%r{shuffle is "blowzy night-frumps vex'd jack q"})
2726
end
2827
end

spec/acceptance/size_spec.rb

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,46 @@
33

44
describe 'size function' do
55
describe 'success' do
6-
it 'single string size' do
7-
pp = <<-EOS
6+
pp1 = <<-EOS
87
$a = 'discombobulate'
98
$o = size($a)
109
notice(inline_template('size is <%= @o.inspect %>'))
11-
EOS
12-
13-
apply_manifest(pp, catch_failures: true) do |r|
10+
EOS
11+
it 'single string size' do
12+
apply_manifest(pp1, catch_failures: true) do |r|
1413
expect(r.stdout).to match(%r{size is 14})
1514
end
1615
end
17-
it 'with empty string' do
18-
pp = <<-EOS
16+
17+
pp2 = <<-EOS
1918
$a = ''
2019
$o = size($a)
2120
notice(inline_template('size is <%= @o.inspect %>'))
22-
EOS
23-
24-
apply_manifest(pp, catch_failures: true) do |r|
21+
EOS
22+
it 'with empty string' do
23+
apply_manifest(pp2, catch_failures: true) do |r|
2524
expect(r.stdout).to match(%r{size is 0})
2625
end
2726
end
28-
it 'with undef' do
29-
pp = <<-EOS
27+
28+
pp3 = <<-EOS
3029
$a = undef
3130
$o = size($a)
3231
notice(inline_template('size is <%= @o.inspect %>'))
33-
EOS
34-
35-
apply_manifest(pp, catch_failures: true) do |r|
32+
EOS
33+
it 'with undef' do
34+
apply_manifest(pp3, catch_failures: true) do |r|
3635
expect(r.stdout).to match(%r{size is 0})
3736
end
3837
end
39-
it 'strings in array' do
40-
pp = <<-EOS
38+
39+
pp4 = <<-EOS
4140
$a = ['discombobulate', 'moo']
4241
$o = size($a)
4342
notice(inline_template('size is <%= @o.inspect %>'))
44-
EOS
45-
46-
apply_manifest(pp, catch_failures: true) do |r|
43+
EOS
44+
it 'strings in array' do
45+
apply_manifest(pp4, catch_failures: true) do |r|
4746
expect(r.stdout).to match(%r{size is 2})
4847
end
4948
end

spec/acceptance/sort_spec.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,25 @@
33

44
describe 'sort function' do
55
describe 'success' do
6-
it 'sorts arrays' do
7-
pp = <<-EOS
6+
pp1 = <<-EOS
87
$a = ["the","public","art","galleries"]
98
# Anagram: Large picture halls, I bet
109
$o = sort($a)
1110
notice(inline_template('sort is <%= @o.inspect %>'))
12-
EOS
13-
14-
apply_manifest(pp, catch_failures: true) do |r|
11+
EOS
12+
it 'sorts arrays' do
13+
apply_manifest(pp1, catch_failures: true) do |r|
1514
expect(r.stdout).to match(%r{sort is \["art", "galleries", "public", "the"\]})
1615
end
1716
end
18-
it 'sorts strings' do
19-
pp = <<-EOS
17+
18+
pp2 = <<-EOS
2019
$a = "blowzy night-frumps vex'd jack q"
2120
$o = sort($a)
2221
notice(inline_template('sort is <%= @o.inspect %>'))
23-
EOS
24-
25-
apply_manifest(pp, catch_failures: true) do |r|
22+
EOS
23+
it 'sorts strings' do
24+
apply_manifest(pp2, catch_failures: true) do |r|
2625
expect(r.stdout).to match(%r{sort is " '-abcdefghijklmnopqrstuvwxyz"})
2726
end
2827
end

spec/acceptance/squeeze_spec.rb

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,37 @@
33

44
describe 'squeeze function' do
55
describe 'success' do
6-
it 'squeezes arrays' do
7-
pp = <<-EOS
6+
pp1 = <<-EOS
87
# Real words!
98
$a = ["wallless", "laparohysterosalpingooophorectomy", "brrr", "goddessship"]
109
$o = squeeze($a)
1110
notice(inline_template('squeeze is <%= @o.inspect %>'))
12-
EOS
13-
14-
apply_manifest(pp, catch_failures: true) do |r|
11+
EOS
12+
it 'squeezes arrays' do
13+
apply_manifest(pp1, catch_failures: true) do |r|
1514
expect(r.stdout).to match(%r{squeeze is \["wales", "laparohysterosalpingophorectomy", "br", "godeship"\]})
1615
end
1716
end
17+
1818
it 'squeezez arrays with an argument'
19-
it 'squeezes strings' do
20-
pp = <<-EOS
19+
pp2 = <<-EOS
2120
$a = "wallless laparohysterosalpingooophorectomy brrr goddessship"
2221
$o = squeeze($a)
2322
notice(inline_template('squeeze is <%= @o.inspect %>'))
24-
EOS
25-
26-
apply_manifest(pp, catch_failures: true) do |r|
23+
EOS
24+
it 'squeezes strings' do
25+
apply_manifest(pp2, catch_failures: true) do |r|
2726
expect(r.stdout).to match(%r{squeeze is "wales laparohysterosalpingophorectomy br godeship"})
2827
end
2928
end
3029

31-
it 'squeezes strings with an argument' do
32-
pp = <<-EOS
30+
pp3 = <<-EOS
3331
$a = "countessship duchessship governessship hostessship"
3432
$o = squeeze($a, 's')
3533
notice(inline_template('squeeze is <%= @o.inspect %>'))
36-
EOS
37-
38-
apply_manifest(pp, catch_failures: true) do |r|
34+
EOS
35+
it 'squeezes strings with an argument' do
36+
apply_manifest(pp3, catch_failures: true) do |r|
3937
expect(r.stdout).to match(%r{squeeze is "counteship ducheship governeship hosteship"})
4038
end
4139
end

spec/acceptance/str2bool_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33

44
describe 'str2bool function' do
55
describe 'success' do
6-
it 'works with "y"' do
7-
pp = <<-EOS
6+
pp = <<-EOS
87
$o = str2bool('y')
98
notice(inline_template('str2bool is <%= @o.inspect %>'))
10-
EOS
11-
9+
EOS
10+
it 'works with "y"' do
1211
apply_manifest(pp, catch_failures: true) do |r|
1312
expect(r.stdout).to match(%r{str2bool is true})
1413
end

spec/acceptance/str2saltedsha512_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33

44
describe 'str2saltedsha512 function' do
55
describe 'success' do
6-
it 'works with "y"' do
7-
pp = <<-EOS
6+
pp = <<-EOS
87
$o = str2saltedsha512('password')
98
notice(inline_template('str2saltedsha512 is <%= @o.inspect %>'))
10-
EOS
11-
9+
EOS
10+
it 'works with "y"' do
1211
apply_manifest(pp, catch_failures: true) do |r|
1312
expect(r.stdout).to match(%r{str2saltedsha512 is "[a-f0-9]{136}"})
1413
end

spec/acceptance/strftime_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33

44
describe 'strftime function' do
55
describe 'success' do
6-
it 'gives the Century' do
7-
pp = <<-EOS
6+
pp = <<-EOS
87
$o = strftime('%C')
98
notice(inline_template('strftime is <%= @o.inspect %>'))
10-
EOS
11-
9+
EOS
10+
it 'gives the Century' do
1211
apply_manifest(pp, catch_failures: true) do |r|
1312
expect(r.stdout).to match(%r{strftime is "20"})
1413
end

0 commit comments

Comments
 (0)