<commit_before>require File.dirname(__FILE__) + '/../../spec_helper'

describe "A Proc instance created using Proc.given" do
  it "is nil if no block given" do
    def answer
      Proc.given.nil?
    end

    answer.should == true
  end

  it "references the same block" do
    def answer(&prc)
      prc.block.object_id == Proc.given.block.object_id
    end

    answer {}.should == true
  end

  it "is able to call the block" do
    def answer(&prc)
      a = [prc.nil?, Proc.given.nil?]
      a << (block_given? == !Proc.given.nil?)
      if block_given?
         a << (prc.object_id == Proc.given.object_id)
         a << (prc.block.object_id == Proc.given.block.object_id)
         a << Proc.given.call(21)
      end
      a<commit_msg>Fixed given_spec? because of changed block_given? behavior<commit_after>require File.dirname(__FILE__) + '/../../spec_helper'

describe "A Proc instance created using Proc.given" do
  it "is nil if no block given" do
    def answer
      Proc.given.nil?
    end

    answer.should == true
  end

  it "references the same block" do
    def answer(&prc)
      prc.block.object_id == Proc.given.block.object_id
    end

    answer {}.should == true
  end

  it "is able to call the block" do
    def answer(&prc)
      a = [prc.nil?, Proc.given.nil?]
      a << (!block_given? == Proc.given.nil?)
      if block_given?
         a << (prc.object_id == Proc.given.object_id)
         a << (prc.block.object_id == Proc.given.block.object_id)
         a << Proc.given.call(21)
      end
      a
{'fraction_non_alphanumeric': 0.12671456564337036, 'fraction_numerical': 0.002612671456564337, 'mean_word_length': 2.352297592997812, 'pattern_counts': {'":': 0, '<': 19, '<?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': '1978727', 'n_tokens_mistral': 560, 'n_tokens_neox': 509, 'n_words': 143}