Sha256: c4679041345d0411545b5f3eaf7b22189cebea1ab55ff85c4b88018cce0bca6f

Contents?: true

Size: 839 Bytes

Versions: 16

Compression:

Stored size: 839 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
    
    it "should allow you to specify a unit of work id for a block" do
      Lumberjack.unit_of_work("foo") do
        Lumberjack.unit_of_work_id.should == "foo"
      end
      Lumberjack.unit_of_work_id.should == nil
    end
  end
  
end

Version data entries

16 entries across 14 versions & 5 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/lumberjack-1.0.9/spec/lumberjack_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/lumberjack-1.0.9/spec/lumberjack_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/lumberjack-1.0.9/spec/lumberjack_spec.rb
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/spec/lumberjack_spec.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/spec/lumberjack_spec.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/spec/lumberjack_spec.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/spec/lumberjack_spec.rb
geminfo-0.1.0 path/gems/lumberjack-1.0.9/spec/lumberjack_spec.rb
lumberjack-1.0.9 spec/lumberjack_spec.rb
lumberjack-1.0.8 spec/lumberjack_spec.rb
lumberjack-1.0.7 spec/lumberjack_spec.rb
lumberjack-1.0.6 spec/lumberjack_spec.rb
lumberjack-1.0.5 spec/lumberjack_spec.rb
lumberjack_aziz_light-1.0.6 spec/lumberjack_spec.rb
lumberjack_aziz_light-1.0.5 spec/lumberjack_spec.rb
lumberjack-1.0.4 spec/lumberjack_spec.rb