Sha256: e38ed45127bcba293f00df26e4ef2263951a62c54a638c152039c0f95af369e1

Contents?: true

Size: 722 Bytes

Versions: 4

Compression:

Stored size: 722 Bytes

Contents

require 'helper'

describe Adapter::Defaults do
  let(:mod) do
    Module.new.tap do |m|
      m.extend(Adapter::Defaults)
    end
  end

  describe "#key_for" do
    it "returns whatever is passed to it" do
      [nil, 'foo', :foo, {:foo => 'bar'}].each do |key|
        mod.key_for(key).should be(key)
      end
    end
  end

  describe "#encode" do
    it "returns whatever is passed to it" do
      [nil, 'foo', :foo, {:foo => 'bar'}].each do |value|
        mod.encode(value).should be(value)
      end
    end
  end

  describe "#decode" do
    it "returns whatever is passed to it" do
      [nil, 'foo', :foo, {:foo => 'bar'}].each do |value|
        mod.decode(value).should be(value)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
adapter-0.6.3 spec/adapter/defaults_spec.rb
adapter-0.6.2 spec/adapter/defaults_spec.rb
adapter-0.6.1 spec/adapter/defaults_spec.rb
adapter-0.6.0 spec/adapter/defaults_spec.rb