Sha256: 48f1f03e65038e745d4c400d802b059914113240aa3268224bfc9a80cb25ea16

Contents?: true

Size: 796 Bytes

Versions: 7

Compression:

Stored size: 796 Bytes

Contents

require "spec_helper"

describe Split::Persistence::SessionAdapter do

  let(:context) { double(:session => {}) }
  subject { Split::Persistence::SessionAdapter.new(context) }

  describe "#[] and #[]=" do
    it "should set and return the value for given key" do
      subject["my_key"] = "my_value"
      subject["my_key"].should eq("my_value")
    end
  end

  describe "#delete" do
    it "should delete the given key" do
      subject["my_key"] = "my_value"
      subject.delete("my_key")
      subject["my_key"].should be_nil
    end
  end

  describe "#keys" do
    it "should return an array of the session's stored keys" do
      subject["my_key"] = "my_value"
      subject["my_second_key"] = "my_second_value"
      subject.keys.should =~ ["my_key", "my_second_key"]
    end
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
split-0.7.2 spec/persistence/session_adapter_spec.rb
split-0.7.1 spec/persistence/session_adapter_spec.rb
split-0.7.0 spec/persistence/session_adapter_spec.rb
split-0.6.6 spec/persistence/session_adapter_spec.rb
split-0.6.5 spec/persistence/session_adapter_spec.rb
split-0.6.4 spec/persistence/session_adapter_spec.rb
split-0.6.3 spec/persistence/session_adapter_spec.rb