<commit_before>require "spec_helper"
require "zombie"

describe Zombie do
  it "is named Ash" do
    zombie = Zombie.new
    zombie.name.should == 'Ash'
  end

  it "has no brains" do
    zombie = Zombie.new
    zombie.brains.should < 1
  end

  it "is hungry" do
    zombie = Zombie.new
    zombie.hungry?.should == true
  end

  it "is hungry predicate matcher example" do
    zombie = Zombie.new
    zombie.should be_hungry
  end

  it "responds to name" do
    zombie = Zombie.new
    zombie.should respond_to(:name)
  end

  it "subject responds to name" do
    subject.should respond_to(:name)
  end

  it "anon subject responds to name" do
    should respond_to(:name)
  end
  
  #same as:
  
  it {should respond_to(:name)}

#-----------#
  it { subject.name.should == 'Ash'}

  #same as:

  its(:name) {should == 'Ash'}

  #use the zomie string as an alias for subject to avoid confusion on curent subject
  context "determine if dead" do
    subject(:zombie){Zombie.new}

    it "should be dead" do
      zombie.should be_dead
    end
    
    #here, its creates an instance of the subject, which in this case is Zombie
    its(:dead?) {should be_true}
  end
end







<commit_msg>Level 3 complete<commit_after>require "spec_helper"
require "zombie"

describe Zombie do
  it "is named Ash" do
    zombie = Zombie.new
    zombie.name.should == 'Ash'
  end

  it "has no brains" do
    zombie = Zombie.new
    zombie.brains.should < 1
  end

  it "is hungry" do
    zombie = Zombie.new
    zombie.hungry?.should == true
  end

  it "is hungry predicate matcher example" do
    zombie = Zombie.new
    zombie.should be_hungry
  end

  it "responds to name" do
    zombie = Zombie.new
    zombie.should respond_to(:name)
  end

  it "subject responds to name" do
    subject.should respond_to(:name)
  end

  it "anon subject responds to name" do
    should respond_to(:name)
  end
  
  #same as:
  
  it {should respond_to(:name)}

#-----------#
  it { subject.name.should == 'Ash'}

  #same as:

  its(:name) {should == 'Ash'}

  #use the zomie string as an alias for subject to avoid confusion on curent subject
  context "determine if dead" do
    subject(:zombie){Zombie.new}

    it "should be dead" do
      zombie.should be_dead
    end
    
    #here, its creates an instance of the subject, which in this case is Zombie
    its(:dead?) {should be_true}
  end

  #LETS REFACTOR

  it 'has no name' do
    @zombie = Zombie.new
    @zombie.name.should be_nil?
  end

  it 'craves brains' do
    @zombie = Zombie.new
    @zombie.should be_craving_brains
  end

  it 'should not be hungry after eating brains' do
    @zombie = Zombie.new
    @zombie.hungry.should be_true
    @zombie.eat(:brains)
    @zombie.hungry.should be_false
  end
end











{'fraction_non_alphanumeric': 0.09659913169319827, 'fraction_numerical': 0.001085383502170767, 'mean_word_length': 2.6286089238845145, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6633505', 'n_tokens_mistral': 1021, 'n_tokens_neox': 990, 'n_words': 316}