Sha256: e1a88ce00546600500f37680d43f52543f294c7362b7955699dbb12ddce2e95d

Contents?: true

Size: 477 Bytes

Versions: 3

Compression:

Stored size: 477 Bytes

Contents

require 'pork/executor'

module Kernel
  def should *args, &block
    Pork::Expect.new(
      Thread.current.group.list.first[:pork_stat], self, *args, &block)
  end
end

module Pork
  module Should
    def execute stat=Stat.new
      thread = Thread.current
      original_group, group = thread.group, ThreadGroup.new
      group.add(thread)
      thread[:pork_stat] = stat
      super
    ensure
      original_group.add(thread)
    end
  end

  Executor.extend(Should)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pork-1.0.2 lib/pork/should.rb
pork-1.0.1 lib/pork/should.rb
pork-1.0.0 lib/pork/should.rb