File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
sentry-ruby/spec/sentry/interfaces Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,7 @@ ruby_version = Gem::Version.new(RUBY_VERSION)
99if ruby_version >= Gem ::Version . new ( "2.7.0" )
1010 gem "debug" , github : "ruby/debug" , platform : :ruby
1111 gem "irb"
12-
13- if ruby_version >= Gem ::Version . new ( "3.0.0" )
14- gem "ruby-lsp-rspec"
15- end
12+ gem "ruby-lsp-rspec" if ruby_version >= Gem ::Version . new ( "3.0.0" ) && RUBY_PLATFORM != "java"
1613end
1714
1815# For RSpec
Original file line number Diff line number Diff line change 1- return unless defined? ( Rack )
2-
31require 'spec_helper'
42
3+ return unless defined? ( Rack )
4+
55RSpec . describe Sentry ::RequestInterface do
66 let ( :env ) { Rack ::MockRequest . env_for ( "/test" ) }
77 let ( :send_default_pii ) { false }
4444 let ( :env ) { Rack ::MockRequest . env_for ( "/test" , additional_headers ) }
4545
4646 it 'transforms headers to conform with the interface' do
47- expect ( subject . headers ) . to eq ( "Content-Length" => "0" , "Version" => "HTTP/1.1" , "X-Request-Id" => "12345678" )
47+ expect ( subject . headers ) . to include ( "Version" => "HTTP/1.1" , "X-Request-Id" => "12345678" )
48+ expect ( subject . headers ) . not_to include ( "Cookie" )
4849 end
4950
5051 context 'from Rails middleware' do
5152 let ( :additional_headers ) { { "action_dispatch.request_id" => "12345678" } }
5253
5354 it 'transforms headers to conform with the interface' do
54- expect ( subject . headers ) . to eq ( "Content-Length" => "0" , "X-Request-Id" => "12345678" )
55+ expect ( subject . headers ) . to include ( "X-Request-Id" => "12345678" )
56+ expect ( subject . headers ) . not_to include ( "Cookie" )
5557 end
5658 end
5759
6163 it "doesn't cause any issue" do
6264 json = JSON . generate ( subject . to_hash )
6365
64- expect ( JSON . parse ( json ) [ "headers" ] ) . to eq ( { "Content-Length" => "0" , " Foo"=> "Tekirda�" } )
66+ expect ( JSON . parse ( json ) [ "headers" ] ) . to include ( " Foo"=> "Tekirda�" )
6567 end
6668 end
6769
You can’t perform that action at this time.
0 commit comments