Sha256: c576db8c63095d562f4e5f632c5183e9aef7be55fe03e52a3c9f5c3ec9e0a069

Contents?: true

Size: 653 Bytes

Versions: 10

Compression:

Stored size: 653 Bytes

Contents

require 'helper'

class TestKey < Test::Unit::TestCase

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

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

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

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
prop-1.0.0 test/test_key.rb
prop-0.7.8 test/test_key.rb
prop-0.7.7 test/test_key.rb
prop-0.7.6 test/test_key.rb
prop-0.7.5 test/test_key.rb
prop-0.7.4 test/test_key.rb
prop-0.7.3 test/test_key.rb
prop-0.7.2 test/test_key.rb
prop-0.7.1 test/test_key.rb
prop-0.7.0 test/test_key.rb