<commit_before>require File.expand_path('../../../../spec_helper', __FILE__)

describe "File::Stat#blocks" do
  before :each do
    @file = tmp('i_exist')
    touch(@file) { |f| f.write "rubinius" }
  end

  after :each do
    rm_r @file
  end

  platform_is_not :windows do
    it "returns the blocks of a File::Stat object" do
      st = File.stat(@file)
      st.blocks.is_a?(Integer).should == true
      st.blocks.should > 0
    end
  end

  platform_is :windows do
    it "returns nil" do
      st = File.stat(@file)
      st.blocks.should be_nil
    end
  end
end<commit_msg>Fix File::Stat#blocks spec to allow zero<commit_after>require File.expand_path('../../../../spec_helper', __FILE__)

describe "File::Stat#blocks" do
  before :each do
    @file = tmp('i_exist')
    touch(@file) { |f| f.write "rubinius" }
  end

  after :each do
    rm_r @file
  end

  platform_is_not :windows do
    it "returns a non-negative integer" do
      st = File.stat(@file)
      st.blocks.is_a?(Integer).should == true
      st.blocks.should >= 0
    end
  end

  platform_is :windows do
    it "returns nil" do
      st = File.stat(@file)
      st.blocks.should be_nil
    end
  end
end
{'fraction_non_alphanumeric': 0.13124470787468248, 'fraction_numerical': 0.001693480101608806, 'mean_word_length': 2.581818181818182, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4894282', 'n_tokens_mistral': 415, 'n_tokens_neox': 406, 'n_words': 113}