Skip to content

Commit 3fc0f68

Browse files
committed
RuboCop style fixes
1 parent d5286ce commit 3fc0f68

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec/functions/pw_hash_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,19 @@
6666

6767
begin
6868
require 'etc'
69-
if Etc.confstr(Etc::CS_GNU_LIBC_VERSION) =~ %r{(\d+)\.(\d+)} and $1.to_i > 2 or ($1.to_i == 2 and $2.to_i >= 28)
69+
if Etc.confstr(Etc::CS_GNU_LIBC_VERSION) =~ %r{(\d+)\.(\d+)} &&
70+
(Regexp.last_match(1).to_i > 2 || (Regexp.last_match(1).to_i == 2 && Regexp.last_match(2).to_i >= 28))
7071
context 'when running on platform with bcrypt' do
7172
it { is_expected.to run.with_params('password', 'bcrypt', '05$salt.salt.salt.salt.sa').and_return('$2b$05$salt.salt.salt.salt.sO5QUgeeLRANZyvfNiKJW5amLo3cVD8nW') }
7273
it { is_expected.to run.with_params('password', 'bcrypt-a', '05$salt.salt.salt.salt.sa').and_return('$2a$05$salt.salt.salt.salt.sO5QUgeeLRANZyvfNiKJW5amLo3cVD8nW') }
7374
it { is_expected.to run.with_params('password', 'bcrypt-x', '05$salt.salt.salt.salt.sa').and_return('$2x$05$salt.salt.salt.salt.sO5QUgeeLRANZyvfNiKJW5amLo3cVD8nW') }
7475
it { is_expected.to run.with_params('password', 'bcrypt-y', '05$salt.salt.salt.salt.sa').and_return('$2y$05$salt.salt.salt.salt.sO5QUgeeLRANZyvfNiKJW5amLo3cVD8nW') }
7576
end
7677
else
77-
pending("Only testing bcrypt results on glibc 2.28 and later")
78+
pending('Only testing bcrypt results on glibc 2.28 and later')
7879
end
7980
rescue NameError
80-
pending("Only testing bcrypt results on glibc")
81+
pending('Only testing bcrypt results on glibc')
8182
end
8283

8384
if RUBY_PLATFORM == 'java' || 'test'.crypt('$1$1') == '$1$1$Bp8CU9Oujr9SSEw53WV6G.'

0 commit comments

Comments
 (0)