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-4.0.1 spec/persistence/session_adapter_spec.rb
split-4.0.0.pre2 spec/persistence/session_adapter_spec.rb
split-4.0.0.pre spec/persistence/session_adapter_spec.rb
ab-split-1.0.2 spec/persistence/session_adapter_spec.rb
ab-split-1.0.1 spec/persistence/session_adapter_spec.rb
ab-split-1.0.0 spec/persistence/session_adapter_spec.rb
split-3.4.1 spec/persistence/session_adapter_spec.rb
split-3.4.0 spec/persistence/session_adapter_spec.rb
split-3.3.2 spec/persistence/session_adapter_spec.rb
split-3.3.1 spec/persistence/session_adapter_spec.rb
split-3.3.0 spec/persistence/session_adapter_spec.rb
split-3.2.0 spec/persistence/session_adapter_spec.rb
split-3.1.1 spec/persistence/session_adapter_spec.rb
split-3.1.0 spec/persistence/session_adapter_spec.rb
split-3.0.0 spec/persistence/session_adapter_spec.rb
split-2.2.0 spec/persistence/session_adapter_spec.rb
split-2.1.0 spec/persistence/session_adapter_spec.rb
split-2.0.0 spec/persistence/session_adapter_spec.rb
split-1.7.0 spec/persistence/session_adapter_spec.rb
split-1.6.0 spec/persistence/session_adapter_spec.rb