diff options
author | Michael Gee <michaelpgee@gmail.com> | 2018-04-15 19:59:06 -0400 |
---|---|---|
committer | Michael Gee <michaelpgee@gmail.com> | 2018-04-29 10:17:10 -0400 |
commit | ece8625e60a0d83af2003f5265bf552c1c0dc460 (patch) | |
tree | 08562a15520da4602f8526bf6776ed995b3752b5 /test/spec_builder.rb | |
parent | d8d688164f4ec316b1e18e3b63090df9450aa8d5 (diff) | |
download | rack-ece8625e60a0d83af2003f5265bf552c1c0dc460.tar.gz |
Strip unicode byte order mark from UTF8 config.ru
Diffstat (limited to 'test/spec_builder.rb')
-rw-r--r-- | test/spec_builder.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/spec_builder.rb b/test/spec_builder.rb index 40e602e8..66c7bf7f 100644 --- a/test/spec_builder.rb +++ b/test/spec_builder.rb @@ -199,7 +199,7 @@ describe Rack::Builder do end) o = Object.new def o.call(env) - @a = 1 if env['PATH_INFO'] == '/b'; + @a = 1 if env['PATH_INFO'] == '/b'; [200, {}, []] end run o @@ -258,6 +258,11 @@ describe Rack::Builder do app, _ = Rack::Builder.parse_file config_file('line.ru') Rack::MockRequest.new(app).get("/").body.to_s.must_equal '1' end + + it "strips leading unicode byte order mark when present" do + app, _ = Rack::Builder.parse_file config_file('bom.ru') + Rack::MockRequest.new(app).get("/").body.to_s.must_equal 'OK' + end end describe 'new_from_string' do |