2015-08-03 13:09:07 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								require "testing_env"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								require "requirements/x11_requirement"
							 | 
						
					
						
							
								
									
										
										
										
											2013-01-29 22:52:10 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-15 09:56:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class X11RequirementTests < Homebrew::TestCase
							 | 
						
					
						
							
								
									
										
										
										
											2013-01-29 22:52:10 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  def test_eql_instances_are_eql
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-15 09:56:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    x = X11Requirement.new
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    y = X11Requirement.new
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-03 16:54:46 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    assert_eql x, y
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-04 16:31:57 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    assert_equal x.hash, y.hash
							 | 
						
					
						
							
								
									
										
										
										
											2013-01-29 22:52:10 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  def test_not_eql_when_hashes_differ
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-15 09:56:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    x = X11Requirement.new("foo")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    y = X11Requirement.new
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-03 16:54:46 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    refute_eql x, y
							 | 
						
					
						
							
								
									
										
										
										
											2014-06-10 22:43:47 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    refute_equal x.hash, y.hash
							 | 
						
					
						
							
								
									
										
										
										
											2013-01-29 22:52:10 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-01 21:26:41 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  def test_different_min_version
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-15 09:56:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    x = X11Requirement.new
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    y = X11Requirement.new("x11", %w[2.5])
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-03 16:54:46 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    refute_eql x, y
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-01 21:26:41 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-01 18:56:14 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  def test_x_env
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-15 09:56:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    x = X11Requirement.new
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-01 18:56:14 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    x.stubs(:satisfied?).returns(true)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    ENV.expects(:x11)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    x.modify_build_environment
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  end
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-02 00:25:01 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  def test_satisfied
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-03 12:45:10 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    MacOS::XQuartz.stubs(:version).returns("2.7.5")
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-02 00:25:01 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    MacOS::XQuartz.stubs(:installed?).returns(true)
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-15 09:56:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    assert_predicate X11Requirement.new, :satisfied?
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-02 00:25:01 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    MacOS::XQuartz.stubs(:installed?).returns(false)
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-15 09:56:04 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    refute_predicate X11Requirement.new, :satisfied?
							 | 
						
					
						
							
								
									
										
										
										
											2014-07-02 00:25:01 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  end
							 | 
						
					
						
							
								
									
										
										
										
											2013-01-29 22:52:10 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								end
							 |