summaryrefslogtreecommitdiff
path: root/spec/ruby/library/net/http/httpheader
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/net/http/httpheader')
-rw-r--r--spec/ruby/library/net/http/httpheader/add_field_spec.rb31
-rw-r--r--spec/ruby/library/net/http/httpheader/basic_auth_spec.rb14
-rw-r--r--spec/ruby/library/net/http/httpheader/canonical_each_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/chunked_spec.rb22
-rw-r--r--spec/ruby/library/net/http/httpheader/content_length_spec.rb54
-rw-r--r--spec/ruby/library/net/http/httpheader/content_range_spec.rb32
-rw-r--r--spec/ruby/library/net/http/httpheader/content_type_spec.rb26
-rw-r--r--spec/ruby/library/net/http/httpheader/delete_spec.rb30
-rw-r--r--spec/ruby/library/net/http/httpheader/each_capitalized_name_spec.rb35
-rw-r--r--spec/ruby/library/net/http/httpheader/each_capitalized_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/each_header_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/each_key_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/each_name_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/each_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/each_value_spec.rb35
-rw-r--r--spec/ruby/library/net/http/httpheader/element_reference_spec.rb39
-rw-r--r--spec/ruby/library/net/http/httpheader/element_set_spec.rb41
-rw-r--r--spec/ruby/library/net/http/httpheader/fetch_spec.rb68
-rw-r--r--spec/ruby/library/net/http/httpheader/fixtures/classes.rb11
-rw-r--r--spec/ruby/library/net/http/httpheader/form_data_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/get_fields_spec.rb39
-rw-r--r--spec/ruby/library/net/http/httpheader/initialize_http_header_spec.rb21
-rw-r--r--spec/ruby/library/net/http/httpheader/key_spec.rb21
-rw-r--r--spec/ruby/library/net/http/httpheader/length_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/main_type_spec.rb24
-rw-r--r--spec/ruby/library/net/http/httpheader/proxy_basic_auth_spec.rb14
-rw-r--r--spec/ruby/library/net/http/httpheader/range_length_spec.rb32
-rw-r--r--spec/ruby/library/net/http/httpheader/range_spec.rb48
-rw-r--r--spec/ruby/library/net/http/httpheader/set_content_type_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/set_form_data_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/set_range_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/each_capitalized.rb31
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/each_header.rb31
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/each_name.rb31
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/set_content_type.rb18
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/set_form_data.rb27
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/set_range.rb89
-rw-r--r--spec/ruby/library/net/http/httpheader/shared/size.rb18
-rw-r--r--spec/ruby/library/net/http/httpheader/size_spec.rb8
-rw-r--r--spec/ruby/library/net/http/httpheader/sub_type_spec.rb32
-rw-r--r--spec/ruby/library/net/http/httpheader/to_hash_spec.rb25
-rw-r--r--spec/ruby/library/net/http/httpheader/type_params_spec.rb24
42 files changed, 0 insertions, 1059 deletions
diff --git a/spec/ruby/library/net/http/httpheader/add_field_spec.rb b/spec/ruby/library/net/http/httpheader/add_field_spec.rb
deleted file mode 100644
index 882d5ac5bb..0000000000
--- a/spec/ruby/library/net/http/httpheader/add_field_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#add_field when passed key, value" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "adds the passed value to the header entry with the passed key" do
- @headers.add_field("My-Header", "a")
- @headers.get_fields("My-Header").should == ["a"]
-
- @headers.add_field("My-Header", "b")
- @headers.get_fields("My-Header").should == ["a", "b"]
-
- @headers.add_field("My-Header", "c")
- @headers.get_fields("My-Header").should == ["a", "b", "c"]
- end
-
- it "is case-insensitive" do
- @headers.add_field("My-Header", "a")
- @headers.get_fields("My-Header").should == ["a"]
-
- @headers.add_field("my-header", "b")
- @headers.get_fields("My-Header").should == ["a", "b"]
-
- @headers.add_field("MY-HEADER", "c")
- @headers.get_fields("My-Header").should == ["a", "b", "c"]
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/basic_auth_spec.rb b/spec/ruby/library/net/http/httpheader/basic_auth_spec.rb
deleted file mode 100644
index fa2a710fe1..0000000000
--- a/spec/ruby/library/net/http/httpheader/basic_auth_spec.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#basic_auth when passed account, password" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "sets the 'Authorization' Header entry for basic authorization" do
- @headers.basic_auth("rubyspec", "rocks")
- @headers["Authorization"].should == "Basic cnVieXNwZWM6cm9ja3M="
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/canonical_each_spec.rb b/spec/ruby/library/net/http/httpheader/canonical_each_spec.rb
deleted file mode 100644
index 0dddd3049b..0000000000
--- a/spec/ruby/library/net/http/httpheader/canonical_each_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/each_capitalized'
-
-describe "Net::HTTPHeader#canonical_each" do
- it_behaves_like :net_httpheader_each_capitalized, :canonical_each
-end
diff --git a/spec/ruby/library/net/http/httpheader/chunked_spec.rb b/spec/ruby/library/net/http/httpheader/chunked_spec.rb
deleted file mode 100644
index 96b758981b..0000000000
--- a/spec/ruby/library/net/http/httpheader/chunked_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#chunked?" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns true if the 'Transfer-Encoding' header entry is set to chunked" do
- @headers.chunked?.should be_false
-
- @headers["Transfer-Encoding"] = "bla"
- @headers.chunked?.should be_false
-
- @headers["Transfer-Encoding"] = "blachunkedbla"
- @headers.chunked?.should be_false
-
- @headers["Transfer-Encoding"] = "chunked"
- @headers.chunked?.should be_true
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/content_length_spec.rb b/spec/ruby/library/net/http/httpheader/content_length_spec.rb
deleted file mode 100644
index e344817e82..0000000000
--- a/spec/ruby/library/net/http/httpheader/content_length_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#content_length" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns nil if no 'Content-Length' header entry is set" do
- @headers.content_length.should be_nil
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when the 'Content-Length' header entry has an invalid format" do
- @headers["Content-Length"] = "invalid"
- -> { @headers.content_length }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
-
- it "returns the value of the 'Content-Length' header entry as an Integer" do
- @headers["Content-Length"] = "123"
- @headers.content_length.should eql(123)
-
- @headers["Content-Length"] = "123valid"
- @headers.content_length.should eql(123)
-
- @headers["Content-Length"] = "valid123"
- @headers.content_length.should eql(123)
- end
-end
-
-describe "Net::HTTPHeader#content_length=" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "removes the 'Content-Length' entry if passed false or nil" do
- @headers["Content-Length"] = "123"
- @headers.content_length = nil
- @headers["Content-Length"].should be_nil
- end
-
- it "sets the 'Content-Length' entry to the passed value" do
- @headers.content_length = "123"
- @headers["Content-Length"].should == "123"
-
- @headers.content_length = "123valid"
- @headers["Content-Length"].should == "123"
- end
-
- it "sets the 'Content-Length' entry to 0 if the passed value is not valid" do
- @headers.content_length = "invalid123"
- @headers["Content-Length"].should == "0"
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/content_range_spec.rb b/spec/ruby/library/net/http/httpheader/content_range_spec.rb
deleted file mode 100644
index ba75f9a9a1..0000000000
--- a/spec/ruby/library/net/http/httpheader/content_range_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#content_range" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns a Range object that represents the 'Content-Range' header entry" do
- @headers["Content-Range"] = "bytes 0-499/1234"
- @headers.content_range.should == (0..499)
-
- @headers["Content-Range"] = "bytes 500-1233/1234"
- @headers.content_range.should == (500..1233)
- end
-
- it "returns nil when there is no 'Content-Range' header entry" do
- @headers.content_range.should be_nil
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when the 'Content-Range' has an invalid format" do
- @headers["Content-Range"] = "invalid"
- -> { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError)
-
- @headers["Content-Range"] = "bytes 123-abc"
- -> { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError)
-
- @headers["Content-Range"] = "bytes abc-123"
- -> { @headers.content_range }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/content_type_spec.rb b/spec/ruby/library/net/http/httpheader/content_type_spec.rb
deleted file mode 100644
index 1f8b4ba326..0000000000
--- a/spec/ruby/library/net/http/httpheader/content_type_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/set_content_type'
-
-describe "Net::HTTPHeader#content_type" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns the content type string, as per 'Content-Type' header entry" do
- @headers["Content-Type"] = "text/html"
- @headers.content_type.should == "text/html"
-
- @headers["Content-Type"] = "text/html;charset=utf-8"
- @headers.content_type.should == "text/html"
- end
-
- it "returns nil if the 'Content-Type' header entry does not exist" do
- @headers.content_type.should be_nil
- end
-end
-
-describe "Net::HTTPHeader#content_type=" do
- it_behaves_like :net_httpheader_set_content_type, :content_type=
-end
diff --git a/spec/ruby/library/net/http/httpheader/delete_spec.rb b/spec/ruby/library/net/http/httpheader/delete_spec.rb
deleted file mode 100644
index 603ae198de..0000000000
--- a/spec/ruby/library/net/http/httpheader/delete_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#delete when passed key" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "removes the header entry with the passed key" do
- @headers["My-Header"] = "test"
- @headers.delete("My-Header")
-
- @headers["My-Header"].should be_nil
- @headers.size.should eql(0)
- end
-
- it "returns the removed values" do
- @headers["My-Header"] = "test"
- @headers.delete("My-Header").should == ["test"]
- end
-
- it "is case-insensitive" do
- @headers["My-Header"] = "test"
- @headers.delete("my-header")
-
- @headers["My-Header"].should be_nil
- @headers.size.should eql(0)
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/each_capitalized_name_spec.rb b/spec/ruby/library/net/http/httpheader/each_capitalized_name_spec.rb
deleted file mode 100644
index 1af2c6939c..0000000000
--- a/spec/ruby/library/net/http/httpheader/each_capitalized_name_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#each_capitalized_name" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- @headers["My-Header"] = "test"
- @headers.add_field("My-Other-Header", "a")
- @headers.add_field("My-Other-Header", "b")
- end
-
- describe "when passed a block" do
- it "yields each header key to the passed block (keys capitalized)" do
- res = []
- @headers.each_capitalized_name do |key|
- res << key
- end
- res.sort.should == ["My-Header", "My-Other-Header"]
- end
- end
-
- describe "when passed no block" do
- it "returns an Enumerator" do
- enumerator = @headers.each_capitalized_name
- enumerator.should be_an_instance_of(Enumerator)
-
- res = []
- enumerator.each do |key|
- res << key
- end
- res.sort.should == ["My-Header", "My-Other-Header"]
- end
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/each_capitalized_spec.rb b/spec/ruby/library/net/http/httpheader/each_capitalized_spec.rb
deleted file mode 100644
index 961a2d051f..0000000000
--- a/spec/ruby/library/net/http/httpheader/each_capitalized_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/each_capitalized'
-
-describe "Net::HTTPHeader#each_capitalized" do
- it_behaves_like :net_httpheader_each_capitalized, :each_capitalized
-end
diff --git a/spec/ruby/library/net/http/httpheader/each_header_spec.rb b/spec/ruby/library/net/http/httpheader/each_header_spec.rb
deleted file mode 100644
index 19634a001b..0000000000
--- a/spec/ruby/library/net/http/httpheader/each_header_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/each_header'
-
-describe "Net::HTTPHeader#each_header" do
- it_behaves_like :net_httpheader_each_header, :each_header
-end
diff --git a/spec/ruby/library/net/http/httpheader/each_key_spec.rb b/spec/ruby/library/net/http/httpheader/each_key_spec.rb
deleted file mode 100644
index ebb17d2eac..0000000000
--- a/spec/ruby/library/net/http/httpheader/each_key_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/each_name'
-
-describe "Net::HTTPHeader#each_key" do
- it_behaves_like :net_httpheader_each_name, :each_key
-end
diff --git a/spec/ruby/library/net/http/httpheader/each_name_spec.rb b/spec/ruby/library/net/http/httpheader/each_name_spec.rb
deleted file mode 100644
index f4533ebcfb..0000000000
--- a/spec/ruby/library/net/http/httpheader/each_name_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/each_name'
-
-describe "Net::HTTPHeader#each_name" do
- it_behaves_like :net_httpheader_each_name, :each_name
-end
diff --git a/spec/ruby/library/net/http/httpheader/each_spec.rb b/spec/ruby/library/net/http/httpheader/each_spec.rb
deleted file mode 100644
index 7ba8434f75..0000000000
--- a/spec/ruby/library/net/http/httpheader/each_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/each_header'
-
-describe "Net::HTTPHeader#each" do
- it_behaves_like :net_httpheader_each_header, :each
-end
diff --git a/spec/ruby/library/net/http/httpheader/each_value_spec.rb b/spec/ruby/library/net/http/httpheader/each_value_spec.rb
deleted file mode 100644
index 3224de7703..0000000000
--- a/spec/ruby/library/net/http/httpheader/each_value_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#each_value" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- @headers["My-Header"] = "test"
- @headers.add_field("My-Other-Header", "a")
- @headers.add_field("My-Other-Header", "b")
- end
-
- describe "when passed a block" do
- it "yields each header entry's joined values" do
- res = []
- @headers.each_value do |value|
- res << value
- end
- res.sort.should == ["a, b", "test"]
- end
- end
-
- describe "when passed no block" do
- it "returns an Enumerator" do
- enumerator = @headers.each_value
- enumerator.should be_an_instance_of(Enumerator)
-
- res = []
- enumerator.each do |key|
- res << key
- end
- res.sort.should == ["a, b", "test"]
- end
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/element_reference_spec.rb b/spec/ruby/library/net/http/httpheader/element_reference_spec.rb
deleted file mode 100644
index 4a35e20d20..0000000000
--- a/spec/ruby/library/net/http/httpheader/element_reference_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#[] when passed key" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns the value of the header entry with the passed key" do
- @headers["My-Header"] = "test"
- @headers["My-Header"].should == "test"
- @headers["My-Other-Header"] = "another test"
- @headers["My-Other-Header"].should == "another test"
- end
-
- it "is case-insensitive" do
- @headers["My-Header"] = "test"
-
- @headers['My-Header'].should == "test"
- @headers['my-Header'].should == "test"
- @headers['My-header'].should == "test"
- @headers['my-header'].should == "test"
- @headers['MY-HEADER'].should == "test"
- end
-
- it "returns multi-element values joined together" do
- @headers["My-Header"] = "test"
- @headers.add_field("My-Header", "another test")
- @headers.add_field("My-Header", "and one more")
-
- @headers["My-Header"].should == "test, another test, and one more"
- end
-
- it "returns nil for non-existing entries" do
- @headers["My-Header"].should be_nil
- @headers["My-Other-Header"].should be_nil
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/element_set_spec.rb b/spec/ruby/library/net/http/httpheader/element_set_spec.rb
deleted file mode 100644
index e9ad64fafc..0000000000
--- a/spec/ruby/library/net/http/httpheader/element_set_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#[]= when passed key, value" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "sets the header entry with the passed key to the passed value" do
- @headers["My-Header"] = "test"
- @headers["My-Header"].should == "test"
-
- @headers["My-Header"] = "overwritten"
- @headers["My-Header"].should == "overwritten"
-
- @headers["My-Other-Header"] = "another test"
- @headers["My-Other-Header"].should == "another test"
- end
-
- it "is case-insensitive" do
- @headers['My-Header'] = "test"
- @headers['my-Header'] = "another test"
- @headers['My-header'] = "and one more test"
- @headers['my-header'] = "and another one"
- @headers['MY-HEADER'] = "last one"
-
- @headers["My-Header"].should == "last one"
- @headers.size.should eql(1)
- end
-
- it "removes the header entry with the passed key when the value is false or nil" do
- @headers['My-Header'] = "test"
- @headers['My-Header'] = nil
- @headers['My-Header'].should be_nil
-
- @headers['My-Header'] = "test"
- @headers['My-Header'] = false
- @headers['My-Header'].should be_nil
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/fetch_spec.rb b/spec/ruby/library/net/http/httpheader/fetch_spec.rb
deleted file mode 100644
index ea15679acb..0000000000
--- a/spec/ruby/library/net/http/httpheader/fetch_spec.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#fetch" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- describe "when passed key" do
- it "returns the header entry for the passed key" do
- @headers["My-Header"] = "test"
- @headers.fetch("My-Header").should == "test"
-
- @headers.add_field("My-Other-Header", "a")
- @headers.add_field("My-Other-Header", "b")
- @headers.add_field("My-Other-Header", "c")
- @headers.fetch("My-Other-Header").should == "a, b, c"
- end
-
- it "is case-insensitive" do
- @headers["My-Header"] = "test"
- @headers.fetch("my-header").should == "test"
- @headers.fetch("MY-HEADER").should == "test"
- end
-
- it "returns nil when there is no entry for the passed key" do
- -> { @headers.fetch("my-header") }.should raise_error(IndexError)
- end
- end
-
- describe "when passed key, default" do
- it "returns the header entry for the passed key" do
- @headers["My-Header"] = "test"
- @headers.fetch("My-Header", "bla").should == "test"
-
- @headers.add_field("My-Other-Header", "a")
- @headers.add_field("My-Other-Header", "b")
- @headers.add_field("My-Other-Header", "c")
- @headers.fetch("My-Other-Header", "bla").should == "a, b, c"
- end
-
- # TODO: This raises a NoMethodError: undefined method `join' for "bla":String
- it "returns the default value when there is no entry for the passed key" do
- @headers.fetch("My-Header", "bla").should == "bla"
- end
- end
-
- describe "when passed key and block" do
- it "returns the header entry for the passed key" do
- @headers["My-Header"] = "test"
- @headers.fetch("My-Header") {}.should == "test"
-
- @headers.add_field("My-Other-Header", "a")
- @headers.add_field("My-Other-Header", "b")
- @headers.add_field("My-Other-Header", "c")
- -> {
- @result = @headers.fetch("My-Other-Header", "bla") {}
- }.should complain(/block supersedes default value argument/)
- @result.should == "a, b, c"
- end
-
- # TODO: This raises a NoMethodError: undefined method `join' for "redaeh-ym":String
- it "yieldsand returns the block's return value when there is no entry for the passed key" do
- @headers.fetch("My-Header") { |key| key.reverse }.should == "redaeh-ym"
- end
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/fixtures/classes.rb b/spec/ruby/library/net/http/httpheader/fixtures/classes.rb
deleted file mode 100644
index b5ec6abd75..0000000000
--- a/spec/ruby/library/net/http/httpheader/fixtures/classes.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module NetHTTPHeaderSpecs
- class Example
- include Net::HTTPHeader
-
- attr_accessor :body
-
- def initialize
- initialize_http_header({})
- end
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/form_data_spec.rb b/spec/ruby/library/net/http/httpheader/form_data_spec.rb
deleted file mode 100644
index 9b29a03159..0000000000
--- a/spec/ruby/library/net/http/httpheader/form_data_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/set_form_data'
-
-describe "Net::HTTPHeader#form_data=" do
- it_behaves_like :net_httpheader_set_form_data, :form_data=
-end
diff --git a/spec/ruby/library/net/http/httpheader/get_fields_spec.rb b/spec/ruby/library/net/http/httpheader/get_fields_spec.rb
deleted file mode 100644
index 1b623bf2a3..0000000000
--- a/spec/ruby/library/net/http/httpheader/get_fields_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#get_fields when passed key" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns an Array containing the values of the header entry with the passed key" do
- @headers["My-Header"] = "a"
- @headers.get_fields("My-Header").should == ["a"]
-
- @headers.add_field("My-Header", "b")
- @headers.get_fields("My-Header").should == ["a", "b"]
- end
-
- it "returns a copy of the header entry values" do
- @headers["My-Header"] = "a"
-
- @headers.get_fields("My-Header").clear
- @headers.get_fields("My-Header").should == ["a"]
-
- @headers.get_fields("My-Header") << "b"
- @headers.get_fields("My-Header").should == ["a"]
- end
-
- it "returns nil for non-existing header entries" do
- @headers.get_fields("My-Header").should be_nil
- @headers.get_fields("My-Other-header").should be_nil
- end
-
- it "is case-insensitive" do
- @headers["My-Header"] = "test"
- @headers.get_fields("My-Header").should == ["test"]
- @headers.get_fields("my-header").should == ["test"]
- @headers.get_fields("MY-HEADER").should == ["test"]
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/initialize_http_header_spec.rb b/spec/ruby/library/net/http/httpheader/initialize_http_header_spec.rb
deleted file mode 100644
index efc5e7d0b2..0000000000
--- a/spec/ruby/library/net/http/httpheader/initialize_http_header_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#initialize_http_header when passed Hash" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.allocate
- end
-
- it "initializes the HTTP Header using the passed Hash" do
- @headers.initialize_http_header("My-Header" => "test", "My-Other-Header" => "another test")
- @headers["My-Header"].should == "test"
- @headers["My-Other-Header"].should == "another test"
- end
-
- it "complains about duplicate keys when in verbose mode" do
- -> do
- @headers.initialize_http_header("My-Header" => "test", "my-header" => "another test")
- end.should complain(/duplicated HTTP header/, verbose: true)
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/key_spec.rb b/spec/ruby/library/net/http/httpheader/key_spec.rb
deleted file mode 100644
index 9099024229..0000000000
--- a/spec/ruby/library/net/http/httpheader/key_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#key? when passed key" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns true if the header entry with the passed key exists" do
- @headers.key?("My-Header").should be_false
- @headers["My-Header"] = "test"
- @headers.key?("My-Header").should be_true
- end
-
- it "is case-insensitive" do
- @headers["My-Header"] = "test"
- @headers.key?("my-header").should be_true
- @headers.key?("MY-HEADER").should be_true
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/length_spec.rb b/spec/ruby/library/net/http/httpheader/length_spec.rb
deleted file mode 100644
index 0d1da149f4..0000000000
--- a/spec/ruby/library/net/http/httpheader/length_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/size'
-
-describe "Net::HTTPHeader#length" do
- it_behaves_like :net_httpheader_size, :length
-end
diff --git a/spec/ruby/library/net/http/httpheader/main_type_spec.rb b/spec/ruby/library/net/http/httpheader/main_type_spec.rb
deleted file mode 100644
index 3e18de6b5b..0000000000
--- a/spec/ruby/library/net/http/httpheader/main_type_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#main_type" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns the 'main-content-type', as per 'Content-Type' header entry" do
- @headers["Content-Type"] = "text/html"
- @headers.main_type.should == "text"
-
- @headers["Content-Type"] = "application/pdf"
- @headers.main_type.should == "application"
-
- @headers["Content-Type"] = "text/html;charset=utf-8"
- @headers.main_type.should == "text"
- end
-
- it "returns nil if the 'Content-Type' header entry does not exist" do
- @headers.main_type.should be_nil
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/proxy_basic_auth_spec.rb b/spec/ruby/library/net/http/httpheader/proxy_basic_auth_spec.rb
deleted file mode 100644
index 8b576ee164..0000000000
--- a/spec/ruby/library/net/http/httpheader/proxy_basic_auth_spec.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#proxy_basic_auth when passed account, password" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "sets the 'Proxy-Authorization' Header entry for basic authorization" do
- @headers.proxy_basic_auth("rubyspec", "rocks")
- @headers["Proxy-Authorization"].should == "Basic cnVieXNwZWM6cm9ja3M="
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/range_length_spec.rb b/spec/ruby/library/net/http/httpheader/range_length_spec.rb
deleted file mode 100644
index b8fce4f690..0000000000
--- a/spec/ruby/library/net/http/httpheader/range_length_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#range_length" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns the length of the Range represented by the 'Content-Range' header entry" do
- @headers["Content-Range"] = "bytes 0-499/1234"
- @headers.range_length.should eql(500)
-
- @headers["Content-Range"] = "bytes 500-1233/1234"
- @headers.range_length.should eql(734)
- end
-
- it "returns nil when there is no 'Content-Range' header entry" do
- @headers.range_length.should be_nil
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when the 'Content-Range' has an invalid format" do
- @headers["Content-Range"] = "invalid"
- -> { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError)
-
- @headers["Content-Range"] = "bytes 123-abc"
- -> { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError)
-
- @headers["Content-Range"] = "bytes abc-123"
- -> { @headers.range_length }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/range_spec.rb b/spec/ruby/library/net/http/httpheader/range_spec.rb
deleted file mode 100644
index 005177f6be..0000000000
--- a/spec/ruby/library/net/http/httpheader/range_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/set_range'
-
-describe "Net::HTTPHeader#range" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns a Range object that represents the 'Range' header entry" do
- @headers["Range"] = "bytes=0-499"
- @headers.range.should == [0..499]
-
- @headers["Range"] = "bytes=500-1233"
- @headers.range.should == [500..1233]
-
- @headers["Range"] = "bytes=10-"
- @headers.range.should == [10..-1]
-
- @headers["Range"] = "bytes=-10"
- @headers.range.should == [-10..-1]
- end
-
- it "returns nil when there is no 'Range' header entry" do
- @headers.range.should be_nil
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when the 'Range' has an invalid format" do
- @headers["Range"] = "invalid"
- -> { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError)
-
- @headers["Range"] = "bytes 123-abc"
- -> { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError)
-
- @headers["Range"] = "bytes abc-123"
- -> { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when the 'Range' was not specified" do
- @headers["Range"] = "bytes=-"
- -> { @headers.range }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
-end
-
-describe "Net::HTTPHeader#range=" do
- it_behaves_like :net_httpheader_set_range, :range=
-end
diff --git a/spec/ruby/library/net/http/httpheader/set_content_type_spec.rb b/spec/ruby/library/net/http/httpheader/set_content_type_spec.rb
deleted file mode 100644
index 125f7a7e0d..0000000000
--- a/spec/ruby/library/net/http/httpheader/set_content_type_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/set_content_type'
-
-describe "Net::HTTPHeader#set_content_type" do
- it_behaves_like :net_httpheader_set_content_type, :set_content_type
-end
diff --git a/spec/ruby/library/net/http/httpheader/set_form_data_spec.rb b/spec/ruby/library/net/http/httpheader/set_form_data_spec.rb
deleted file mode 100644
index 14c66ae01c..0000000000
--- a/spec/ruby/library/net/http/httpheader/set_form_data_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/set_form_data'
-
-describe "Net::HTTPHeader#set_form_data" do
- it_behaves_like :net_httpheader_set_form_data, :set_form_data
-end
diff --git a/spec/ruby/library/net/http/httpheader/set_range_spec.rb b/spec/ruby/library/net/http/httpheader/set_range_spec.rb
deleted file mode 100644
index 85b9c50422..0000000000
--- a/spec/ruby/library/net/http/httpheader/set_range_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/set_range'
-
-describe "Net::HTTPHeader#set_range" do
- it_behaves_like :net_httpheader_set_range, :set_range
-end
diff --git a/spec/ruby/library/net/http/httpheader/shared/each_capitalized.rb b/spec/ruby/library/net/http/httpheader/shared/each_capitalized.rb
deleted file mode 100644
index 3bac409876..0000000000
--- a/spec/ruby/library/net/http/httpheader/shared/each_capitalized.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-describe :net_httpheader_each_capitalized, shared: true do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- @headers["my-header"] = "test"
- @headers.add_field("my-Other-Header", "a")
- @headers.add_field("My-Other-header", "b")
- end
-
- describe "when passed a block" do
- it "yields each header entry to the passed block (capitalized keys, values joined)" do
- res = []
- @headers.send(@method) do |key, value|
- res << [key, value]
- end
- res.sort.should == [["My-Header", "test"], ["My-Other-Header", "a, b"]]
- end
- end
-
- describe "when passed no block" do
- it "returns an Enumerator" do
- enumerator = @headers.send(@method)
- enumerator.should be_an_instance_of(Enumerator)
-
- res = []
- enumerator.each do |*key|
- res << key
- end
- res.sort.should == [["My-Header", "test"], ["My-Other-Header", "a, b"]]
- end
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/shared/each_header.rb b/spec/ruby/library/net/http/httpheader/shared/each_header.rb
deleted file mode 100644
index 6bf3a6ddfe..0000000000
--- a/spec/ruby/library/net/http/httpheader/shared/each_header.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-describe :net_httpheader_each_header, shared: true do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- @headers["My-Header"] = "test"
- @headers.add_field("My-Other-Header", "a")
- @headers.add_field("My-Other-Header", "b")
- end
-
- describe "when passed a block" do
- it "yields each header entry to the passed block (keys in lower case, values joined)" do
- res = []
- @headers.send(@method) do |key, value|
- res << [key, value]
- end
- res.sort.should == [["my-header", "test"], ["my-other-header", "a, b"]]
- end
- end
-
- describe "when passed no block" do
- it "returns an Enumerator" do
- enumerator = @headers.send(@method)
- enumerator.should be_an_instance_of(Enumerator)
-
- res = []
- enumerator.each do |*key|
- res << key
- end
- res.sort.should == [["my-header", "test"], ["my-other-header", "a, b"]]
- end
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/shared/each_name.rb b/spec/ruby/library/net/http/httpheader/shared/each_name.rb
deleted file mode 100644
index efc6a09dfd..0000000000
--- a/spec/ruby/library/net/http/httpheader/shared/each_name.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-describe :net_httpheader_each_name, shared: true do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- @headers["My-Header"] = "test"
- @headers.add_field("My-Other-Header", "a")
- @headers.add_field("My-Other-Header", "b")
- end
-
- describe "when passed a block" do
- it "yields each header key to the passed block (keys in lower case)" do
- res = []
- @headers.send(@method) do |key|
- res << key
- end
- res.sort.should == ["my-header", "my-other-header"]
- end
- end
-
- describe "when passed no block" do
- it "returns an Enumerator" do
- enumerator = @headers.send(@method)
- enumerator.should be_an_instance_of(Enumerator)
-
- res = []
- enumerator.each do |key|
- res << key
- end
- res.sort.should == ["my-header", "my-other-header"]
- end
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/shared/set_content_type.rb b/spec/ruby/library/net/http/httpheader/shared/set_content_type.rb
deleted file mode 100644
index b7359bdca6..0000000000
--- a/spec/ruby/library/net/http/httpheader/shared/set_content_type.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-describe :net_httpheader_set_content_type, shared: true do
- describe "when passed type, params" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "sets the 'Content-Type' header entry based on the passed type and params" do
- @headers.send(@method, "text/html")
- @headers["Content-Type"].should == "text/html"
-
- @headers.send(@method, "text/html", "charset" => "utf-8")
- @headers["Content-Type"].should == "text/html; charset=utf-8"
-
- @headers.send(@method, "text/html", "charset" => "utf-8", "rubyspec" => "rocks")
- @headers["Content-Type"].split(/; /).sort.should == %w[charset=utf-8 rubyspec=rocks text/html]
- end
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/shared/set_form_data.rb b/spec/ruby/library/net/http/httpheader/shared/set_form_data.rb
deleted file mode 100644
index db20b18803..0000000000
--- a/spec/ruby/library/net/http/httpheader/shared/set_form_data.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-describe :net_httpheader_set_form_data, shared: true do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- describe "when passed params" do
- it "automatically set the 'Content-Type' to 'application/x-www-form-urlencoded'" do
- @headers.send(@method, "cmd" => "search", "q" => "ruby", "max" => "50")
- @headers["Content-Type"].should == "application/x-www-form-urlencoded"
- end
-
- it "sets self's body based on the passed form parameters" do
- @headers.send(@method, "cmd" => "search", "q" => "ruby", "max" => "50")
- @headers.body.split("&").sort.should == ["cmd=search", "max=50", "q=ruby"]
- end
- end
-
- describe "when passed params, separator" do
- it "sets self's body based on the passed form parameters and the passed separator" do
- @headers.send(@method, {"cmd" => "search", "q" => "ruby", "max" => "50"}, "&")
- @headers.body.split("&").sort.should == ["cmd=search", "max=50", "q=ruby"]
-
- @headers.send(@method, {"cmd" => "search", "q" => "ruby", "max" => "50"}, ";")
- @headers.body.split(";").sort.should == ["cmd=search", "max=50", "q=ruby"]
- end
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/shared/set_range.rb b/spec/ruby/library/net/http/httpheader/shared/set_range.rb
deleted file mode 100644
index 87f51d46f3..0000000000
--- a/spec/ruby/library/net/http/httpheader/shared/set_range.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-describe :net_httpheader_set_range, shared: true do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- describe "when passed nil" do
- it "returns nil" do
- @headers.send(@method, nil).should be_nil
- end
-
- it "deletes the 'Range' header entry" do
- @headers["Range"] = "bytes 0-499/1234"
- @headers.send(@method, nil)
- @headers["Range"].should be_nil
- end
- end
-
- describe "when passed Numeric" do
- it "sets the 'Range' header entry based on the passed Numeric" do
- @headers.send(@method, 10)
- @headers["Range"].should == "bytes=0-9"
-
- @headers.send(@method, -10)
- @headers["Range"].should == "bytes=-10"
-
- @headers.send(@method, 10.9)
- @headers["Range"].should == "bytes=0-9"
- end
- end
-
- describe "when passed Range" do
- it "sets the 'Range' header entry based on the passed Range" do
- @headers.send(@method, 10..200)
- @headers["Range"].should == "bytes=10-200"
-
- @headers.send(@method, 1..5)
- @headers["Range"].should == "bytes=1-5"
-
- @headers.send(@method, 1...5)
- @headers["Range"].should == "bytes=1-4"
-
- @headers.send(@method, 234..567)
- @headers["Range"].should == "bytes=234-567"
-
- @headers.send(@method, -5..-1)
- @headers["Range"].should == "bytes=-5"
-
- @headers.send(@method, 1..-1)
- @headers["Range"].should == "bytes=1-"
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when the first Range element is negative" do
- -> { @headers.send(@method, -10..5) }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when the last Range element is negative" do
- -> { @headers.send(@method, 10..-5) }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when the last Range element is smaller than the first" do
- -> { @headers.send(@method, 10..5) }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
- end
-
- describe "when passed start, end" do
- it "sets the 'Range' header entry based on the passed start and length values" do
- @headers.send(@method, 10, 200)
- @headers["Range"].should == "bytes=10-209"
-
- @headers.send(@method, 1, 5)
- @headers["Range"].should == "bytes=1-5"
-
- @headers.send(@method, 234, 567)
- @headers["Range"].should == "bytes=234-800"
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when start is negative" do
- -> { @headers.send(@method, -10, 5) }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when start + length is negative" do
- -> { @headers.send(@method, 10, -15) }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
-
- it "raises a Net::HTTPHeaderSyntaxError when length is negative" do
- -> { @headers.send(@method, 10, -4) }.should raise_error(Net::HTTPHeaderSyntaxError)
- end
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/shared/size.rb b/spec/ruby/library/net/http/httpheader/shared/size.rb
deleted file mode 100644
index e2b1e4c22b..0000000000
--- a/spec/ruby/library/net/http/httpheader/shared/size.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-describe :net_httpheader_size, shared: true do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns the number of header entries in self" do
- @headers.send(@method).should eql(0)
-
- @headers["a"] = "b"
- @headers.send(@method).should eql(1)
-
- @headers["b"] = "b"
- @headers.send(@method).should eql(2)
-
- @headers["c"] = "c"
- @headers.send(@method).should eql(3)
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/size_spec.rb b/spec/ruby/library/net/http/httpheader/size_spec.rb
deleted file mode 100644
index a7d78f96e0..0000000000
--- a/spec/ruby/library/net/http/httpheader/size_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-require_relative 'shared/size'
-
-describe "Net::HTTPHeader#size" do
- it_behaves_like :net_httpheader_size, :size
-end
diff --git a/spec/ruby/library/net/http/httpheader/sub_type_spec.rb b/spec/ruby/library/net/http/httpheader/sub_type_spec.rb
deleted file mode 100644
index 3c73ca0027..0000000000
--- a/spec/ruby/library/net/http/httpheader/sub_type_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#sub_type" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns the 'sub-content-type', as per 'Content-Type' header entry" do
- @headers["Content-Type"] = "text/html"
- @headers.sub_type.should == "html"
-
- @headers["Content-Type"] = "application/pdf"
- @headers.sub_type.should == "pdf"
-
- @headers["Content-Type"] = "text/html;charset=utf-8"
- @headers.sub_type.should == "html"
- end
-
- it "returns nil if no 'sub-content-type' is set" do
- @headers["Content-Type"] = "text"
- @headers.sub_type.should be_nil
-
- @headers["Content-Type"] = "text;charset=utf-8"
- @headers.sub_type.should be_nil
- end
-
- it "returns nil if the 'Content-Type' header entry does not exist" do
- @headers.sub_type.should be_nil
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/to_hash_spec.rb b/spec/ruby/library/net/http/httpheader/to_hash_spec.rb
deleted file mode 100644
index 8c1d36c30a..0000000000
--- a/spec/ruby/library/net/http/httpheader/to_hash_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require_relative '../../../../spec_helper'
-require 'net/http'
-require_relative 'fixtures/classes'
-
-describe "Net::HTTPHeader#to_hash" do
- before :each do
- @headers = NetHTTPHeaderSpecs::Example.new
- end
-
- it "returns a Hash representing all Header entries (keys in lower case, values as arrays)" do
- @headers.to_hash.should == {}
-
- @headers["My-Header"] = "test"
- @headers.to_hash.should == { "my-header" => ["test"] }
-
- @headers.add_field("My-Header", "another test")
- @headers.to_hash.should == { "my-header" => ["test", "another test"] }
- end
-
- it "does not allow modifying the headers from the returned hash" do
- @headers.to_hash["my-header"] = ["test"]
- @headers.to_hash.should == {}
- @headers.key?("my-header").should be_false
- end
-end
diff --git a/spec/ruby/library/net/http/httpheader/type_params_spec.rb b/spec/ruby/library/net/http/httpheader/type_params_spec.rb
deleted file mode 100644
index e77be7ea85..0000000000
--- a/spec/ruby/library/net/http/httpheader/type_params_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-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