test_gpg: add initial tests
This commit is contained in:
		
							parent
							
								
									92a6a557f5
								
							
						
					
					
						commit
						2c81083f3c
					
				
							
								
								
									
										22
									
								
								Library/Homebrew/test/test_gpg.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								Library/Homebrew/test/test_gpg.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
			
		||||
require "testing_env"
 | 
			
		||||
require "gpg"
 | 
			
		||||
 | 
			
		||||
class GpgTest < Homebrew::TestCase
 | 
			
		||||
  def setup
 | 
			
		||||
    skip "GPG Unavailable" unless Gpg.available?
 | 
			
		||||
    @dir = Pathname.new(mktmpdir)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def teardown
 | 
			
		||||
    @dir.rmtree
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def test_create_test_key
 | 
			
		||||
    Dir.chdir(@dir) do
 | 
			
		||||
      with_environment("HOME" => @dir) do
 | 
			
		||||
        shutup { Gpg.create_test_key(@dir) }
 | 
			
		||||
        assert_predicate @dir/".gnupg/secring.gpg", :exist?
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user