Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 29 lines (22 sloc) 0.821 kB
39c7187 @chriskite update tests to run under 1.9.2
chriskite authored
1 $:.unshift(File.dirname(__FILE__))
2 require 'spec_helper'
5646b34 @chriskite CookieStore extends Hash instead of delegating
chriskite authored
3
4 module Anemone
5 describe CookieStore do
6
7 it "should start out empty if no cookies are specified" do
8 CookieStore.new.empty?.should be true
9 end
10
754c608 @chriskite WEBrick::Cookie for cookie parsing and storage
chriskite authored
11 it "should accept a Hash of cookies in the constructor" do
12 CookieStore.new({'test' => 'cookie'})['test'].value.should == 'cookie'
13 end
14
15 it "should be able to merge an HTTP cookie string" do
16 cs = CookieStore.new({'a' => 'a', 'b' => 'b'})
17 cs.merge! "a=A; path=/, c=C; path=/"
18 cs['a'].value.should == 'A'
19 cs['b'].value.should == 'b'
20 cs['c'].value.should == 'C'
21 end
22
23 it "should have a to_s method to turn the cookies into a string for the HTTP Cookie header" do
24 CookieStore.new({'a' => 'a', 'b' => 'b'}).to_s.should == 'a=a;b=b'
25 end
26
5646b34 @chriskite CookieStore extends Hash instead of delegating
chriskite authored
27 end
28 end
Something went wrong with that request. Please try again.