Skip to content

Commit

Permalink
Tweaks to specs after rebasing on top of #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Buch committed Mar 17, 2014
1 parent 14fc9cb commit 9b1eea0
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions spec/redis_session_store_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,28 @@
it_should_behave_like 'serializer'
end
end

context 'custom' do
let :custom_serializer do
Class.new do
def self.load(value)
{ 'some' => 'data' }
end

def self.dump(value)
'somedata'
end
end
end

let(:options) { { serializer: custom_serializer } }
let(:expected_encoding) { 'somedata' }

it_should_behave_like 'serializer'
end
end

describe 'handling marshal errors' do
describe 'handling decode errors' do
context 'when a class is serialized that does not exist' do
before do
store.stub(
Expand Down Expand Up @@ -368,7 +387,7 @@
end
end

context 'when the marshalled data is invalid' do
context 'when the encoded data is invalid' do
before do
store.stub(
redis: double('redis', get: "\x00\x00\x00\x00")
Expand Down

0 comments on commit 9b1eea0

Please sign in to comment.