-
Notifications
You must be signed in to change notification settings - Fork 216
Expand file tree
/
Copy pathstorage_spec.rb
More file actions
59 lines (52 loc) · 1.88 KB
/
storage_spec.rb
File metadata and controls
59 lines (52 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
require 'spec_helper'
require 'support/local_hash_ticket_store'
require 'fileutils'
describe CASClient::Tickets::Storage::AbstractTicketStore do
describe "#store_service_session_lookup" do
it "should raise an exception" do
expect { subject.store_service_session_lookup("service_ticket", mock_controller_with_session) }.to raise_exception 'Implement this in a subclass!'
end
end
describe "#cleanup_service_session_lookup" do
it "should raise an exception" do
expect { subject.cleanup_service_session_lookup("service_ticket") }.to raise_exception 'Implement this in a subclass!'
end
end
describe "#save_pgt_iou" do
it "should raise an exception" do
expect { subject.save_pgt_iou("pgt_iou", "pgt") }.to raise_exception 'Implement this in a subclass!'
end
end
describe "#retrieve_pgt" do
it "should raise an exception" do
expect { subject.retrieve_pgt("pgt_iou") }.to raise_exception 'Implement this in a subclass!'
end
end
describe "#get_session_for_service_ticket" do
it "should raise an exception" do
expect { subject.get_session_for_service_ticket("service_ticket") }.to raise_exception 'Implement this in a subclass!'
end
end
end
describe CASClient::Tickets::Storage::LocalDirTicketStore do
let(:dir) {File.join(SPEC_TMP_DIR, "local_dir_ticket_store")}
after do
FileUtils.remove_dir(dir)
end
describe "when the sessions directory does not exist" do
before do
File.exist?(File.join(dir, "sessions")).should be_false
end
it_should_behave_like "a ticket store" do
let(:ticket_store) {described_class.new(:storage_dir => dir)}
end
end
describe "when the session directory exists" do
before do
FileUtils.mkdir_p(File.join(dir, "sessions"))
end
it_should_behave_like "a ticket store" do
let(:ticket_store) {described_class.new(:storage_dir => dir)}
end
end
end