<commit_before>shared_context "a Celluloid Task" do |task_class|
  class MockActor
    attr_reader :tasks

    def initialize
      @tasks = []
    end
  end

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

  subject { task_class.new(task_type) { 42 } }

  before :each do
    Thread.current[:actor] = actor
  end

  after :each do
    Thread.current[:actor] = nil
  end

  it "resumes" do
    subject.should be_running
    subject.resume
    subject.should_not be_running
  end
end<commit_msg>Marginally improved task specs<commit_after>shared_context "a Celluloid Task" do |task_class|
  class MockActor
    attr_reader :tasks

    def initialize
      @tasks = []
    end
  end

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

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

  before :each do
    Thread.current[:actor] = actor
  end

  after :each do
    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
{'fraction_non_alphanumeric': 0.0946372239747634, 'fraction_numerical': 0.0015772870662460567, 'mean_word_length': 2.965625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '750802', 'n_tokens_mistral': 433, 'n_tokens_neox': 418, 'n_words': 104}