Index: test/unit/subversion_test.rb =================================================================== --- test/unit/subversion_test.rb (revision 590) +++ test/unit/subversion_test.rb (working copy) @@ -228,6 +228,17 @@ assert_equal "hello world\n", io.string end end + + def test_svn_command_uses_user_password_when_provided + svn = Subversion.new(:username => 'jer', :password => "crap") + + svn.expects(:info).with(dummy_project).returns(Subversion::Info.new(10, 10)) + svn.expects(:execute).with(["svn", "--non-interactive", "log", "--revision", "HEAD:10", "--verbose", "--xml", + "--username", "jer", "--password", "crap"], + {:stderr => './svn.err'}).yields(StringIO.new(LOG_ENTRY)) + + svn.latest_revision(dummy_project) + end def numbers(revisions) revisions.map { |r| Index: app/models/subversion.rb =================================================================== --- app/models/subversion.rb (revision 590) +++ app/models/subversion.rb (working copy) @@ -24,8 +24,6 @@ @url or raise 'URL not specified' options = [@url, target_directory] - options << "--username" << @username if @username - options << "--password" << @password if @password options << "--revision" << revision_number(revision) if revision # need to read from command output, because otherwise tests break @@ -101,6 +99,7 @@ command << "--non-interactive" unless @interactive command << operation command += options.compact.flatten + command += ['--username', @username, '--password', @password] if @username and @password command end