Sha256: d1555eb2c4d39bb8b0a359d4728eb118034a14618e93b0d083c76e940a952aa9

Contents?: true

Size: 608 Bytes

Versions: 6

Compression:

Stored size: 608 Bytes

Contents

require 'spec_helper'

describe Lumberjack do
  
  context "unit of work" do
    it "should create a unit work with a unique id in a block" do
      Lumberjack.unit_of_work_id.should == nil
      Lumberjack.unit_of_work do
        id_1 = Lumberjack.unit_of_work_id
        id_1.should match(/^[0-9A-F]{12}$/)
        Lumberjack.unit_of_work do
          id_2 = Lumberjack.unit_of_work_id
          id_2.should match(/^[0-9A-F]{12}$/)
          id_2.should_not == id_1
        end
        id_1.should == Lumberjack.unit_of_work_id
      end
      Lumberjack.unit_of_work_id.should == nil
    end
  end
  
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/lumberjack-1.0.3/spec/lumberjack_spec.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/lumberjack-1.0.3/spec/lumberjack_spec.rb
lumberjack-1.0.3 spec/lumberjack_spec.rb
lumberjack-1.0.2 spec/lumberjack_spec.rb
lumberjack-1.0.1 spec/lumberjack_spec.rb
lumberjack-1.0.0 spec/lumberjack_spec.rb