<commit_before>require 'spec_helper'

describe Celluloid::SyncCall do
  class CallExampleActor
    include Celluloid

    def initialize(next_actor = nil)
      @next = next_actor
    end

    def actual_method; end

    def chained_call_ids
      [call_chain_id, @next.call_chain_id]
    end
  end

  subject { CallExampleActor.new }

  it "aborts with NoMethodError when a nonexistent method is called" do
    expect do
      subject.the_method_that_wasnt_there
    end.to raise_exception(NoMethodError)

    subject.should be_alive
  end

  it "aborts with ArgumentError when a method is called with too many arguments" do
    expect do
      subject.actual_method("with too many arguments")
    end.to raise_exception(ArgumentError)

    subject.should be_alive
  end

  it "preserves call chains across synchronous calls" do
    actor2 = CallExampleActor.new(subject)

    uuid, next_actor_uuid = actor2.chained_call_ids
    uuid.should eq next_actor_uuid
  end
end<commit_msg>Reverted changes to the explicit `subject`.<commit_after>require 'spec_helper'

describe Celluloid::SyncCall do
  class CallExampleActor
    include Celluloid

    def initialize(next_actor = nil)
      @next = next_actor
    end

    def actual_method; end

    def chained_call_ids
      [call_chain_id, @next.call_chain_id]
    end
  end

  let(:actor) { CallExampleActor.new }

  it "aborts with NoMethodError when a nonexistent method is called" do
    expect do
      actor.the_method_that_wasnt_there
    end.to raise_exception(NoMethodError)

    actor.should be_alive
  end

  it "aborts with ArgumentError when a method is called with too many arguments" do
    expect do
      actor.actual_method("with too many arguments")
    end.to raise_exception(ArgumentError)

    actor.should be_alive
  end

  it "preserves call chains across synchronous calls" do
    actor2 = CallExampleActor.new(actor)

    uuid, next_actor_uuid = actor2.chained_call_ids
    uuid.should eq next_actor_uuid
  end
end
{'fraction_non_alphanumeric': 0.052313883299798795, 'fraction_numerical': 0.002012072434607646, 'mean_word_length': 3.510204081632653, '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': '1527084', 'n_tokens_mistral': 625, 'n_tokens_neox': 598, 'n_words': 180}