|
32 | 32 | it 'marks in_app correctly' do |
33 | 33 | frames = hash[:exception][:values][0][:stacktrace][:frames] |
34 | 34 | expect(frames[0][:filename]).to eq("test/some/other/path") |
| 35 | + expect(frames[0][:abs_path]).to eq("test/some/other/path") |
35 | 36 | expect(frames[0][:in_app]).to eq(true) |
36 | 37 | expect(frames[1][:filename]).to eq("/app/some/other/path") |
37 | 38 | expect(frames[1][:in_app]).to eq(false) |
|
41 | 42 | expect(frames[3][:in_app]).to eq(true) |
42 | 43 | expect(frames[4][:filename]).to eq("vendor/bundle/some_gem.rb") |
43 | 44 | expect(frames[4][:in_app]).to eq(false) |
44 | | - expect(frames[5][:filename]).to eq("vendor/bundle/cache/other_gem.rb") |
| 45 | + expect(frames[5][:filename]).to eq("dummy/test_rails_app/vendor/bundle/cache/other_gem.rb") |
45 | 46 | expect(frames[5][:in_app]).to eq(false) |
46 | 47 | end |
47 | 48 |
|
|
50 | 51 | $LOAD_PATH << "#{Rails.root}/app/models" |
51 | 52 | frames = hash[:exception][:values][0][:stacktrace][:frames] |
52 | 53 | expect(frames[3][:filename]).to eq("app/models/user.rb") |
| 54 | + expect(frames[3][:abs_path]).to eq("#{Rails.root}/app/models/user.rb") |
53 | 55 | $LOAD_PATH.delete("#{Rails.root}/app/models") |
54 | 56 | end |
55 | 57 | end |
|
58 | 60 | it 'normalizes the filename using the load path' do |
59 | 61 | $LOAD_PATH.push "vendor/bundle" |
60 | 62 | frames = hash[:exception][:values][0][:stacktrace][:frames] |
61 | | - expect(frames[5][:filename]).to eq("cache/other_gem.rb") |
| 63 | + expect(frames[5][:filename]).to eq("dummy/test_rails_app/vendor/bundle/cache/other_gem.rb") |
| 64 | + expect(frames[5][:abs_path]).to eq("#{Rails.root}/vendor/bundle/cache/other_gem.rb") |
62 | 65 | $LOAD_PATH.pop |
63 | 66 | end |
64 | 67 | end |
65 | 68 |
|
66 | 69 | context "when a non-in_app path under project_root isn't on the load path" do |
67 | 70 | it 'normalizes the filename using project_root' do |
68 | 71 | frames = hash[:exception][:values][0][:stacktrace][:frames] |
69 | | - expect(frames[5][:filename]).to eq("vendor/bundle/cache/other_gem.rb") |
| 72 | + expect(frames[5][:filename]).to eq("dummy/test_rails_app/vendor/bundle/cache/other_gem.rb") |
| 73 | + expect(frames[5][:abs_path]).to eq("#{Rails.root}/vendor/bundle/cache/other_gem.rb") |
70 | 74 | end |
71 | 75 | end |
72 | 76 | end |
|
0 commit comments