Skip to content

Commit

Permalink
Marginally improved task specs
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Aug 15, 2012
1 parent f1c5b0a commit f51aa7f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions spec/support/task_examples.rb
Expand Up @@ -7,10 +7,11 @@ def initialize
end
end

let(:task_type) { :foobar }
let(:actor) { MockActor.new }
let(:task_type) { :foobar }
let(:suspend_state) { :doing_something }
let(:actor) { MockActor.new }

subject { task_class.new(task_type) { 42 } }
subject { task_class.new(task_type) { Celluloid::Task.suspend(suspend_state) } }

before :each do
Thread.current[:actor] = actor
Expand All @@ -20,9 +21,16 @@ def initialize
Thread.current[:actor] = nil
end

it "begins with status :new" do
subject.status.should == :new
end

it "resumes" do
subject.should be_running
subject.resume
subject.status.should == suspend_state
subject.resume
subject.should_not be_running
end

end

0 comments on commit f51aa7f

Please sign in to comment.