| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-03 10:49:58 +02:00
										 |  |  | require_relative "shared_examples/invalid_option" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-06 08:29:14 +02:00
										 |  |  | describe Cask::Cmd::Home, :cask do | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |   before do | 
					
						
							| 
									
										
										
										
											2017-05-19 21:48:21 +02:00
										 |  |  |     allow(described_class).to receive(:open_url) | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-03 10:49:58 +02:00
										 |  |  |   it_behaves_like "a command that handles invalid options" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |   it "opens the homepage for the specified Cask" do | 
					
						
							| 
									
										
										
										
											2019-09-22 11:41:46 -04:00
										 |  |  |     expect(described_class).to receive(:open_url).with("https://brew.sh/") | 
					
						
							| 
									
										
										
										
											2017-05-19 21:48:21 +02:00
										 |  |  |     described_class.run("local-caffeine") | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it "works for multiple Casks" do | 
					
						
							| 
									
										
										
										
											2019-09-22 11:41:46 -04:00
										 |  |  |     expect(described_class).to receive(:open_url).with("https://brew.sh/") | 
					
						
							|  |  |  |     expect(described_class).to receive(:open_url).with("https://brew.sh/") | 
					
						
							| 
									
										
										
										
											2017-05-19 21:48:21 +02:00
										 |  |  |     described_class.run("local-caffeine", "local-transmission") | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it "opens the project page when no Cask is specified" do | 
					
						
							| 
									
										
										
										
											2019-04-13 19:40:35 +01:00
										 |  |  |     expect(described_class).to receive(:open_url).with("https://brew.sh/") | 
					
						
							| 
									
										
										
										
											2017-05-19 21:48:21 +02:00
										 |  |  |     described_class.run | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |   end | 
					
						
							|  |  |  | end |