summaryrefslogtreecommitdiff
path: root/spec/ruby/library/net-http/httpheader/basic_auth_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/net-http/httpheader/basic_auth_spec.rb')
-rw-r--r--spec/ruby/library/net-http/httpheader/basic_auth_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/library/net-http/httpheader/basic_auth_spec.rb b/spec/ruby/library/net-http/httpheader/basic_auth_spec.rb
new file mode 100644
index 0000000000..db7ca84d13
--- /dev/null
+++ b/spec/ruby/library/net-http/httpheader/basic_auth_spec.rb
@@ -0,0 +1,14 @@
+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