| 
									
										
										
										
											2023-04-07 22:21:46 +08:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | require "linux_runner_spec" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | describe LinuxRunnerSpec do | 
					
						
							|  |  |  |   let(:spec) do | 
					
						
							|  |  |  |     described_class.new( | 
					
						
							|  |  |  |       name:      "Linux", | 
					
						
							|  |  |  |       runner:    "ubuntu-latest", | 
					
						
							|  |  |  |       container: { image: "ghcr.io/homebrew/ubuntu22.04:master", options: "--user=linuxbrew" }, | 
					
						
							|  |  |  |       workdir:   "/github/home", | 
					
						
							|  |  |  |       timeout:   360, | 
					
						
							|  |  |  |       cleanup:   false, | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   it "has immutable attributes" do | 
					
						
							|  |  |  |     [:name, :runner, :container, :workdir, :timeout, :cleanup].each do |attribute| | 
					
						
							| 
									
										
										
										
											2023-12-18 09:34:01 -08:00
										 |  |  |       expect(spec.respond_to?(:"#{attribute}=")).to be(false) | 
					
						
							| 
									
										
										
										
											2023-04-07 22:21:46 +08:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   describe "#to_h" do | 
					
						
							|  |  |  |     it "returns an object that responds to `#to_json`" do | 
					
						
							|  |  |  |       expect(spec.to_h.respond_to?(:to_json)).to be(true) | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |