aserafin / grape_logging

Request logging for Grape!
MIT License
147 stars 76 forks source link

Failing tests #68

Open utkarsh2102 opened 4 years ago

utkarsh2102 commented 4 years ago

Hi,

Whilst building this against Ruby2.7 and grape (1.3.1), I get the following failures:

Failures:

  1) GrapeLogging::Formatters::Rails#call exception data returns a string with a backtrace
     Failure/Error: expect(lines[1]).to include 'grape_logging'
       expected "\t/usr/share/rubygems-integration/all/gems/rspec-core-3.9.1/lib/rspec/core/example.rb:257:in `instance_exec'" to include "grape_logging"
     # ./spec/lib/grape_logging/formatters/rails_spec.rb:40:in `block (4 levels) in <top (required)>'

  2) GrapeLogging::Loggers::Response with a parseable JSON body returns an array of parseable JSON objects
     Failure/Error:
       expect(subject.parameters(nil, response)).to eq({
         response: [response.body.first.dup]
       })

       expected: {:response=>["{\"one\": \"two\", \"three\": {\"four\": 5}}"]}
            got: {:response=>[{"one"=>"two", "three"=>{"four"=>5}}]}

       (compared using ==)

       Diff:
       @@ -1,2 +1,2 @@
       -:response => ["{\"one\": \"two\", \"three\": {\"four\": 5}}"],
       +:response => [{"one"=>"two", "three"=>{"four"=>5}}],

     # ./spec/lib/grape_logging/loggers/response_spec.rb:11:in `block (3 levels) in <top (required)>'

Finished in 0.10391 seconds (files took 1.5 seconds to load)
34 examples, 2 failures

Failed examples:

rspec ./spec/lib/grape_logging/formatters/rails_spec.rb:33 # GrapeLogging::Formatters::Rails#call exception data returns a string with a backtrace
rspec ./spec/lib/grape_logging/loggers/response_spec.rb:10 # GrapeLogging::Loggers::Response with a parseable JSON body returns an array of parseable JSON objects
utkarsh2102 commented 4 years ago

I believe the first test has been failing for a long time. See: https://github.com/aserafin/grape_logging/issues/50

For the latter, I think it's because of some changes in grape?