File tree 2 files changed +7
-3
lines changed
spec/unit/influx_db/rails
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,11 @@ class Configuration
67
67
set_defaults (
68
68
measurement_name : "rails" . freeze ,
69
69
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 . match? ( /^\s *$/ ) )
73
+ end
74
+ } ,
71
75
rails_app_name : nil ,
72
76
ignored_environments : %w[ test cucumber selenium ] . freeze ,
73
77
environment : ::Rails . env ,
Original file line number Diff line number Diff line change 26
26
27
27
it "removes empty strings" do
28
28
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 )
30
30
end
31
31
32
32
it "returns symbols" do
36
36
37
37
it "removes nil" do
38
38
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 )
40
40
end
41
41
42
42
it "leaves arrays alone" do
You can’t perform that action at this time.
0 commit comments