Sha256: 0780960b5534565d306ff2d238cf8ce276f61487533efcb8dfdac42a00be2090

Contents?: true

Size: 564 Bytes

Versions: 3

Compression:

Stored size: 564 Bytes

Contents

require 'helper'

describe Prop::Key do
  describe "#build" do
    it "return a hexdigested key" do
      assert_match /prop\/[a-f0-9]+/, Prop::Key.build(:handle => :hello, :key => [ "foo", 2, :bar ], :interval => 60)
    end
  end

  describe "#normalize" do
    it "turn a Fixnum into a String" do
      assert_equal "3", Prop::Key.normalize(3)
    end

    it "return a String" do
      assert_equal "S", Prop::Key.normalize("S")
    end

    it "flatten and join an Array" do
      assert_equal "1/B/3", Prop::Key.normalize([ 1, "B", "3" ])
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
prop-1.1.0 test/test_key.rb
prop-1.0.2 test/test_key.rb
prop-1.0.1 test/test_key.rb