diff options
Diffstat (limited to 'spec/ruby/library/net-http/httpheader/type_params_spec.rb')
-rw-r--r-- | spec/ruby/library/net-http/httpheader/type_params_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/ruby/library/net-http/httpheader/type_params_spec.rb b/spec/ruby/library/net-http/httpheader/type_params_spec.rb new file mode 100644 index 0000000000..ac97e2b48c --- /dev/null +++ b/spec/ruby/library/net-http/httpheader/type_params_spec.rb @@ -0,0 +1,24 @@ +require_relative '../../../spec_helper' +require 'net/http' +require_relative 'fixtures/classes' + +describe "Net::HTTPHeader#type_params" do + before :each do + @headers = NetHTTPHeaderSpecs::Example.new + end + + it "returns additional 'Content-Type' information as a Hash" do + @headers["Content-Type"] = "text/html;charset=utf-8" + @headers.type_params.should == {"charset" => "utf-8"} + + @headers["Content-Type"] = "text/html; charset=utf-8; rubyspec=rocks" + @headers.type_params.should == {"charset" => "utf-8", "rubyspec" => "rocks"} + end + + it "returns an empty Hash when no additional 'Content-Type' information is set" do + @headers.type_params.should == {} + + @headers["Content-Type"] = "text/html" + @headers.type_params.should == {} + end +end |