mirror of
				https://gitea.invidious.io/iv-org/shard-spectator.git
				synced 2024-08-15 00:53:35 +00:00 
			
		
		
		
	Cache implicit subject
This commit is contained in:
		
							parent
							
								
									d738494fdf
								
							
						
					
					
						commit
						5ea83f51bb
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -13,6 +13,8 @@ class SpectatorTestContext < SpectatorContext | |||
|   include ::Spectator::DSL::Matchers | ||||
|   include ::Spectator::DSL::Values | ||||
| 
 | ||||
|   @subject = ::Spectator::LazyWrapper.new | ||||
| 
 | ||||
|   # Initial implicit subject for tests. | ||||
|   # This method should be overridden by example groups when an object is described. | ||||
|   private def _spectator_implicit_subject | ||||
|  | @ -22,8 +24,7 @@ class SpectatorTestContext < SpectatorContext | |||
|   # Initial subject for tests. | ||||
|   # Returns the implicit subject. | ||||
|   # This method should be overridden when an explicit subject is defined by the DSL. | ||||
|   # TODO: Subject needs to be cached. | ||||
|   private def subject | ||||
|     _spectator_implicit_subject | ||||
|     @subject.get { _spectator_implicit_subject } | ||||
|   end | ||||
| end | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue