mirror of
				https://gitea.invidious.io/iv-org/shard-spectator.git
				synced 2024-08-15 00:53:35 +00:00 
			
		
		
		
	Use name instead of block_arg
This commit is contained in:
		
							parent
							
								
									7e6080aa5f
								
							
						
					
					
						commit
						311b4b0f2f
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -27,7 +27,7 @@ module Spectator | |||
|     end | ||||
| 
 | ||||
|     macro sample(collection, &block) | ||||
|       {% block_arg = block.args.empty? ? :value.id : block.args.first.id %} | ||||
|       {% name = block.args.empty? ? :value.id : block.args.first.id %} | ||||
| 
 | ||||
|       def %collection | ||||
|         {{collection}} | ||||
|  | @ -38,12 +38,12 @@ module Spectator | |||
|       end | ||||
| 
 | ||||
|       class Context%sample < {{@type.id}} | ||||
|         ::Spectator::SpecBuilder.start_sample_group({{collection.stringify}}, :%sample, {{block_arg.stringify}}) do |values| | ||||
|         ::Spectator::SpecBuilder.start_sample_group({{collection.stringify}}, :%sample, {{name.stringify}}) do |values| | ||||
|           sample = {{@type.id}}.new(values) | ||||
|           sample.%to_a | ||||
|         end | ||||
| 
 | ||||
|         def {{block_arg}} | ||||
|         def {{name}} | ||||
|           @spectator_test_values.get_value(:%sample, typeof(%to_a.first)) | ||||
|         end | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue