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

platform_is :windows do
  describe "Etc.getgrnam" do
    it "returns nil" do
      Etc.getgrnam(1).should == nil
      Etc.getgrnam(nil).should == nil
      Etc.getgrnam('nil').should == nil
    end
  end
end

platform_is_not :windows do
  describe "Etc.getgrnam" do
    it "returns a Etc::Group struct instance for the given group" do
      gr = Etc.getgrnam("daemon")
      gr.is_a?(Etc::Group).should == true
    end

    it "only accepts strings as argument" do
      lambda {
        Etc.getgrnam(123)
        Etc.getgrnam(nil)
      }.should raise_error(TypeError)
    end
  end
end
<commit_msg>Avoid using the "daemon" group because it might not exist<commit_after>require File.expand_path('../../../spec_helper', __FILE__)
require 'etc'

platform_is :windows do
  describe "Etc.getgrnam" do
    it "returns nil" do
      Etc.getgrnam(1).should == nil
      Etc.getgrnam(nil).should == nil
      Etc.getgrnam('nil').should == nil
    end
  end
end

platform_is_not :windows do
  describe "Etc.getgrnam" do
    it "returns a Etc::Group struct instance for the given group" do
      gr_name = Etc.getgrent.name
      Etc.endgrent
      gr = Etc.getgrnam(gr_name)
      gr.is_a?(Etc::Group).should == true
    end

    it "only accepts strings as argument" do
      lambda {
        Etc.getgrnam(123)
        Etc.getgrnam(nil)
      }.should raise_error(TypeError)
    end
  end
end

{'fraction_non_alphanumeric': 0.11382113821138211, 'fraction_numerical': 0.005420054200542005, 'mean_word_length': 2.720403022670025, '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': '6691446', 'n_tokens_mistral': 519, 'n_tokens_neox': 512, 'n_words': 134}