Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Added specs for Titan::Thread.remove_dead_threads
Browse files Browse the repository at this point in the history
  • Loading branch information
flippingbits committed Dec 1, 2010
1 parent 5d5db24 commit 8a89a2c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/titan/thread_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,18 @@ def new_thread(id=nil)
Titan::Thread.save_threads
end
end

describe ".remove_dead_threads" do
it "should synchronize the threads" do
Titan::Thread.should_receive(:save_threads)
Titan::Thread.remove_dead_threads
end

it "should return all threads" do
# avoid initializing a new Hash object
Titan::Thread.stub!(:load_threads)
new_thread
Titan::Thread.remove_dead_threads.should equal(Titan::Thread.all)
end
end
end

0 comments on commit 8a89a2c

Please sign in to comment.