Skip to content

Commit 981439f

Browse files
committed
rubocop functions
1 parent 8796c63 commit 981439f

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

spec/functions/keys_spec.rb

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError, %r{Requires hash to work with}) } if Puppet.version < '5.5.0'
1313
it { is_expected.to run.with_params({}).and_return([]) }
1414
it { is_expected.to run.with_params('key' => 'value').and_return(['key']) }
15-
it 'returns the array of keys', if: Puppet.version < '5.5.0' do
16-
result = subject.call([{ 'key1' => 'value1', 'key2' => 'value2' }])
17-
expect(result).to match_array(%w[key1 key2])
18-
end
1915

20-
it 'runs with UTF8 and double byte characters', if: Puppet.version < '5.5.0' do
21-
result = subject.call([{ 'ҝểү' => '√ẳŀμệ', 'キー' => '値' }])
22-
expect(result).to match_array(%w[ҝểү キー])
16+
if Puppet.version < '5.5.0'
17+
it 'returns the array of keys' do
18+
result = subject.call([{ 'key1' => 'value1', 'key2' => 'value2' }])
19+
expect(result).to match_array(%w[key1 key2])
20+
end
21+
22+
it 'runs with UTF8 and double byte characters', :if => Puppet.version < '5.5.0' do
23+
result = subject.call([{ 'ҝểү' => '√ẳŀμệ', 'キー' => '値' }])
24+
expect(result).to match_array(%w[ҝểү キー])
25+
end
2326
end
2427
end

spec/functions/values_spec.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError, %r{Requires hash to work with}) } if Puppet.version < '5.5.0'
1313
it { is_expected.to run.with_params({}).and_return([]) }
1414
it { is_expected.to run.with_params('key' => 'value').and_return(['value']) }
15-
it 'returns the array of values', if: Puppet.version < '5.5.0' do
16-
result = subject.call([{ 'key1' => 'value1', 'key2' => 'value2', 'duplicate_value_key' => 'value2' }])
17-
expect(result).to match_array(%w[value1 value2 value2])
18-
end
1915

20-
it 'runs with UTF8 and double byte characters', if: Puppet.version < '5.5.0' do
21-
result = subject.call([{ 'かぎ' => '使用', 'ҝĕұ' => '√ẩŀứệ', 'ҝĕұďŭрļǐçằťè' => '√ẩŀứệ' }])
22-
expect(result).to match_array(['使用', '√ẩŀứệ', '√ẩŀứệ'])
16+
if Puppet.version < '5.5.0'
17+
it 'returns the array of values' do
18+
result = subject.call([{ 'key1' => 'value1', 'key2' => 'value2', 'duplicate_value_key' => 'value2' }])
19+
expect(result).to match_array(%w[value1 value2 value2])
20+
end
21+
it 'runs with UTF8 and double byte characters' do
22+
result = subject.call([{ 'かぎ' => '使用', 'ҝĕұ' => '√ẩŀứệ', 'ҝĕұďŭрļǐçằťè' => '√ẩŀứệ' }])
23+
expect(result).to match_array(['使用', '√ẩŀứệ', '√ẩŀứệ'])
24+
end
2325
end
2426
end

0 commit comments

Comments
 (0)