Sha256: 5f58fdd8990a35ae02705cc42d22c73319893dc5b6a86776b82781ab170da72e

Contents?: true

Size: 708 Bytes

Versions: 13

Compression:

Stored size: 708 Bytes

Contents

require 'spec_helper'
describe ::Trax::Model::UUIDPrefix do
  subject{ described_class.new('1a') }

  describe ".all" do
    it { described_class.all.should include("a1") }
    it { described_class.all.first.should eq "0a" }
    it { described_class.all.last.should eq "f9" }
  end
  describe "#next" do
    let(:test_subject) { Product.uuid_prefix }

    it { test_subject.next.should eq '1b' }

    context "lower to higher register transitions" do
      let(:test_subject) { ::Trax::Model::UUIDPrefix.new('9f') }
      it { test_subject.next.should eq 'a0'}
    end
  end

  describe "#previous" do
    let(:test_subject) { Product.uuid_prefix }

    it { test_subject.previous.should eq '0f' }
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
trax_model-0.1.0 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.99 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.98 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.97 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.96 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.95 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.93 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.92 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.91 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.9 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.8 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.7 spec/trax/model/uuid_prefix_spec.rb
trax_model-0.0.6 spec/trax/model/uuid_prefix_spec.rb