Merge pull request #3926 from maxim-belkin/svn_remote_exists_bool
add ? to svn_remote_exists
This commit is contained in:
		
						commit
						cfe3e253f5
					
				| @ -955,7 +955,7 @@ class ResourceAuditor | ||||
|       elsif strategy <= SubversionDownloadStrategy | ||||
|         next unless DevelopmentTools.subversion_handles_most_https_certificates? | ||||
|         next unless Utils.svn_available? | ||||
|         unless Utils.svn_remote_exists url | ||||
|         unless Utils.svn_remote_exists? url | ||||
|           problem "The URL #{url} is not a valid svn URL" | ||||
|         end | ||||
|       end | ||||
|  | ||||
| @ -15,10 +15,10 @@ describe Utils do | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|   describe "#self.svn_remote_exists" do | ||||
|   describe "#self.svn_remote_exists?" do | ||||
|     it "returns true when svn is not available" do | ||||
|       allow(Utils).to receive(:svn_available?).and_return(false) | ||||
|       expect(described_class.svn_remote_exists("blah")).to be_truthy | ||||
|       expect(described_class.svn_remote_exists?("blah")).to be_truthy | ||||
|     end | ||||
| 
 | ||||
|     context "when svn is available" do | ||||
| @ -27,7 +27,7 @@ describe Utils do | ||||
|       end | ||||
| 
 | ||||
|       it "returns false when remote does not exist" do | ||||
|         expect(described_class.svn_remote_exists(HOMEBREW_CACHE/"install")).to be_falsey | ||||
|         expect(described_class.svn_remote_exists?(HOMEBREW_CACHE/"install")).to be_falsey | ||||
|       end | ||||
| 
 | ||||
|       it "returns true when remote exists", :needs_network, :needs_svn do | ||||
| @ -36,7 +36,7 @@ describe Utils do | ||||
| 
 | ||||
|         HOMEBREW_CACHE.cd { system svn, "checkout", remote } | ||||
| 
 | ||||
|         expect(described_class.svn_remote_exists(HOMEBREW_CACHE/"install")).to be_truthy | ||||
|         expect(described_class.svn_remote_exists?(HOMEBREW_CACHE/"install")).to be_truthy | ||||
|       end | ||||
|     end | ||||
|   end | ||||
|  | ||||
| @ -8,7 +8,7 @@ module Utils | ||||
|     @svn = quiet_system HOMEBREW_SHIMS_PATH/"scm/svn", "--version" | ||||
|   end | ||||
| 
 | ||||
|   def self.svn_remote_exists(url) | ||||
|   def self.svn_remote_exists?(url) | ||||
|     return true unless svn_available? | ||||
|     quiet_system "svn", "ls", url, "--depth", "empty" | ||||
|   end | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Mike McQuaid
						Mike McQuaid