File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed 
spec/unit/influx_db/rails Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,11 @@ class Configuration
6767      set_defaults ( 
6868        measurement_name :     "rails" . freeze , 
6969        ignored_hooks :        [ ] . freeze , 
70-         tags_middleware :      -> ( tags )  {  tags  } , 
70+         tags_middleware :      lambda  {  |tags |
71+                                 tags . reject  do  |_key ,  value |
72+                                   value . nil?  || ( value . is_a? ( String )  && value . squish . empty? ) 
73+                                 end 
74+                               } , 
7175        rails_app_name :       nil , 
7276        ignored_environments : %w[ test  cucumber  selenium ] . freeze , 
7377        environment :          ::Rails . env , 
Original file line number Diff line number Diff line change 2626
2727    it  "removes empty strings"  do 
2828      subject  =  described_class . new ( config : config ,  tags : {  hans : "" ,  franz : "   "  } ) 
29-       expect ( subject . to_h ) . not_to  a_hash_including ( hans :  "" ,   franz :  "   " ) 
29+       expect ( subject . to_h ) . not_to  a_hash_including ( :hans ,   :franz ) 
3030    end 
3131
3232    it  "returns symbols"  do 
3636
3737    it  "removes nil"  do 
3838      subject  =  described_class . new ( config : config ,  tags : {  hans : nil  } ) 
39-       expect ( subject . to_h ) . not_to  a_hash_including ( hans :  nil ) 
39+       expect ( subject . to_h ) . not_to  a_hash_including ( :hans ) 
4040    end 
4141
4242    it  "leaves arrays alone"  do 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments