File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 end
5353
5454 around do |example |
55- appender = SemanticLogger . add_appender ( io : semantic_logger_io , formatter : :json )
55+ appender =
56+ SemanticLogger . add_appender ( io : semantic_logger_io , formatter : :json )
5657 example . run
5758 ensure
5859 SemanticLogger . remove_appender ( appender )
9394 semantic_logger_io . rewind
9495
9596 log_lines = semantic_logger_io . readlines . map { |line | JSON . parse ( line ) }
96- tagged_lines = log_lines . select do |line |
97- line [ 'named_tags' ] == { 'import_class' => 'ImmunisationImport' , 'import_id' => import . id }
98- end
97+ tagged_lines =
98+ log_lines . select do |line |
99+ line [ "named_tags" ] ==
100+ { "import_class" => "ImmunisationImport" , "import_id" => import . id }
101+ end
99102
100103 expect ( tagged_lines . size ) . to eq ( 1 )
101- expect ( tagged_lines . first ) . to include ( ' message' => ' started' )
104+ expect ( tagged_lines . first ) . to include ( " message" => " started" )
102105
103- payload = tagged_lines . first [ ' payload' ]
104- started_at = Time . zone . parse ( payload [ ' started_at' ] )
106+ payload = tagged_lines . first [ " payload" ]
107+ started_at = Time . zone . parse ( payload [ " started_at" ] )
105108 expect ( started_at . to_i ) . to eq ( import . created_at . to_i )
106109 end
107110 end
You can’t perform that action at this time.
0 commit comments