Sha256: 7913dc3253662203f60f7ebbffddf383b96cf44324f91716d29952a089b6ef9d

Contents?: true

Size: 843 Bytes

Versions: 27

Compression:

Stored size: 843 Bytes

Contents

# frozen_string_literal: true
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

27 entries across 27 versions & 2 rubygems

Version Path
split-1.5.0 spec/persistence/session_adapter_spec.rb
split-1.4.5 spec/persistence/session_adapter_spec.rb
split-1.4.4 spec/persistence/session_adapter_spec.rb
split-1.4.3 spec/persistence/session_adapter_spec.rb
split-1.4.2 spec/persistence/session_adapter_spec.rb
split-1.4.1 spec/persistence/session_adapter_spec.rb
split-1.4.0 spec/persistence/session_adapter_spec.rb