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

describe :io_tty, :shared => true do
  with_tty do
    # Yeah, this will probably break.
    it "returns true if this stream is a terminal device (TTY)" do
      File.open('/dev/tty') {|f| f.send @method }.should == true
    end
  end

  it "returns false if this stream is not a terminal device (TTY)" do
    File.open(__FILE__) {|f| f.send @method }.should == false
  end

  it "raises IOError on closed stream" do
    lambda { IOSpecs.closed_io.send @method }.should raise_error(IOError)
  end
end
<commit_msg>workaround for tty on osx<commit_after>require File.expand_path('../../fixtures/classes', __FILE__)

describe :io_tty, :shared => true do
  with_tty do
    begin
      # check to enabled tty
      File.open('/dev/tty')

      # Yeah, this will probably break.
      it "returns true if this stream is a terminal device (TTY)" do
        File.open('/dev/tty') {|f| f.send @method }.should == true
      end
    rescue Errno::ENXIO
      # workaround for not configured environment
    end
  end

  it "returns false if this stream is not a terminal device (TTY)" do
    File.open(__FILE__) {|f| f.send @method }.should == false
  end

  it "raises IOError on closed stream" do
    lambda { IOSpecs.closed_io.send @method }.should raise_error(IOError)
  end
end

{'fraction_non_alphanumeric': 0.11185185185185186, 'fraction_numerical': 0.0, 'mean_word_length': 3.057057057057057, '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': '2842609', 'n_tokens_mistral': 437, 'n_tokens_neox': 429, 'n_words': 156}