Sha256: 75d1bfef639be6c447a731ed699724262f15ed69bcefbaf329bd375dbb3cd4dc

Contents?: true

Size: 813 Bytes

Versions: 9

Compression:

Stored size: 813 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"
      expect(subject["my_key"]).to eq("my_value")
    end
  end

  describe "#delete" do
    it "should delete the given key" do
      subject["my_key"] = "my_value"
      subject.delete("my_key")
      expect(subject["my_key"]).to 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"
      expect(subject.keys).to match(["my_key", "my_second_key"])
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
split-1.3.2 spec/persistence/session_adapter_spec.rb
split-1.3.1 spec/persistence/session_adapter_spec.rb
split-1.3.0 spec/persistence/session_adapter_spec.rb
split-1.2.1 spec/persistence/session_adapter_spec.rb
split-1.2.0 spec/persistence/session_adapter_spec.rb
split-1.1.0 spec/persistence/session_adapter_spec.rb
split-1.0.0 spec/persistence/session_adapter_spec.rb
split-0.8.0 spec/persistence/session_adapter_spec.rb
split-0.7.3 spec/persistence/session_adapter_spec.rb