This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 22c01555 We can now assume password-from-stdin is available
22c01555 is described below
commit 22c0155515162ca62e088f3cabe9c10d3e302dc0
Author: Sebb <[email protected]>
AuthorDate: Fri Sep 13 23:23:30 2024 +0100
We can now assume password-from-stdin is available
---
lib/spec/lib/svn_spec.rb | 19 ++-----------------
lib/spec/lib/svn_wunderbar_spec.rb | 18 +++---------------
2 files changed, 5 insertions(+), 32 deletions(-)
diff --git a/lib/spec/lib/svn_spec.rb b/lib/spec/lib/svn_spec.rb
index 1e607614..8263ef9a 100644
--- a/lib/spec/lib/svn_spec.rb
+++ b/lib/spec/lib/svn_spec.rb
@@ -241,16 +241,6 @@ describe ASF::SVN do
end
end
- describe 'ASF::SVN.passwordStdinOK?' do
- it 'passwordStdinOK? should return true or false' do
- res = ASF::SVN.passwordStdinOK?
- expect(res).to be(true).or be(false)
- # show what we are working with
- ver = %x(svn --version --quiet).chomp
- puts "\n>> version = '#{ver}' passwordStdinOK = #{res}"
- end
- end
-
describe 'ASF::SVN.svn' do
it 'svn(nil,nil) should raise error' do
expect { ASF::SVN.svn(nil,nil) }.to raise_error(ArgumentError, 'command
must not be nil')
@@ -319,13 +309,8 @@ describe ASF::SVN do
it "_svn_build_cmd('help', 'path', {user: 'whimsy', password: 'pass})
should include username" do
cmd, stdin = ASF::SVN._svn_build_cmd('help', 'path', {user: 'whimsy',
password: 'pass'})
exp = ['svn', 'help', '--non-interactive', ['--username', 'whimsy',
'--no-auth-cache'], '--', 'path']
- if ASF::SVN.passwordStdinOK?
- expect(stdin).to eq('pass')
- expect(cmd-exp).to eq([['--password-from-stdin']])
- else
- expect(stdin).to eq(nil)
- expect(cmd-exp).to eq([['--password', 'pass']])
- end
+ expect(stdin).to eq('pass')
+ expect(cmd-exp).to eq([['--password-from-stdin']])
end
it "_svn_build_cmd('help', 'path', {user: 'whimsysvn'}) should not include
username" do
diff --git a/lib/spec/lib/svn_wunderbar_spec.rb
b/lib/spec/lib/svn_wunderbar_spec.rb
index a9475441..a08f2f14 100644
--- a/lib/spec/lib/svn_wunderbar_spec.rb
+++ b/lib/spec/lib/svn_wunderbar_spec.rb
@@ -113,11 +113,7 @@ describe 'ASF::SVN.svn_' do
end
expect(rc).to eq(0)
act = out['transcript'][1]
- if ASF::SVN.passwordStdinOK?
- exp = [['svn', 'help', '--non-interactive', ['--username', 'a',
'--no-auth-cache'], ['--password-from-stdin'], '--', 'help'], {:stdin=>'b'}]
- else
- exp = [['svn', 'help', '--non-interactive', ['--username', 'a',
'--no-auth-cache'], ['--password', 'b'], '--', 'help'], {}]
- end
+ exp = [['svn', 'help', '--non-interactive', ['--username', 'a',
'--no-auth-cache'], ['--password-from-stdin'], '--', 'help'], {:stdin=>'b'}]
expect(act).to eq(exp.inspect)
end
@@ -127,11 +123,7 @@ describe 'ASF::SVN.svn_' do
end
expect(rc).to eq(0)
act = out['transcript'][1]
- if ASF::SVN.passwordStdinOK?
- exp = [['svn', 'help', '--non-interactive', ['--username', 'a',
'--no-auth-cache'], ['--password-from-stdin'], '--', 'help'], {:stdin=>'b'}]
- else
- exp = [['svn', 'help', '--non-interactive', ['--username', 'a',
'--no-auth-cache'], ['--password', 'b'], '--', 'help'], {}]
- end
+ exp = [['svn', 'help', '--non-interactive', ['--username', 'a',
'--no-auth-cache'], ['--password-from-stdin'], '--', 'help'], {:stdin=>'b'}]
expect(act).to eq(exp.inspect)
end
@@ -151,11 +143,7 @@ describe 'ASF::SVN.svn_' do
end
expect(rc).to eq(0)
act = out['transcript'][1]
- if ASF::SVN.passwordStdinOK?
- exp = [['svn', 'help', '--non-interactive', ['--username', 'user',
'--no-auth-cache'], ['--password-from-stdin'], '--', 'help'], {:stdin=>'pass'}]
- else
- exp = [['svn', 'help', '--non-interactive', ['--username', 'user',
'--no-auth-cache'], ['--password', 'pass'], '--', 'help'], {}]
- end
+ exp = [['svn', 'help', '--non-interactive', ['--username', 'user',
'--no-auth-cache'], ['--password-from-stdin'], '--', 'help'], {:stdin=>'pass'}]
expect(act).to eq(exp.inspect)
end