Skip to content

Instantly share code, notes, and snippets.

@sgonyea
Created September 1, 2011 19:13
Show Gist options
  • Save sgonyea/1186991 to your computer and use it in GitHub Desktop.
Save sgonyea/1186991 to your computer and use it in GitHub Desktop.
describe "MTPS" do
subject { Thrift::MutexableThreadPoolServer.new nil, nil }
def Thread.block=(block); @block = block; end
def Thread.block(&block)
self.block = block if block_given?
return(@block)
end
let(:server) { subject }
let(:thread_block) { Thread.block }
let(:queue_thread) { proc { server.queue_thread }}
before(:each) {
Thread.block = nil
stub(Thread).new.implemented_by(Thread.method(:block))
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment