<commit_before>require 'helper'
require 'mac/say'

describe 'Mac::Say as a macOS `say` wrapper' do
  describe 'On a class level' do
    it "must have a VERSION constant" do
      Mac::Say.const_get('VERSION').wont_be_empty
    end

    it "must return available voices as an Array of Hashes" do
      Mac::Say.voices.wont_be_empty
      Mac::Say.voices.must_be_kind_of Array
    end

    it "must return specific Hash structure for a voice" do
      voice = Mac::Say.voices.first
      voice.wont_be_empty
      voice.must_be_kind_of Hash
      voice.keys.must_equal [:name, :iso_code, :sample]
    end

    it "must return specific Hash structure for an iso_code" do
      voice = Mac::Say.voices.first
      voice.wont_be_empty
      voice[:iso_code].must_be_kind_of Hash
      voice[:iso_code].keys.must_equal [:language, :country]
    end

    it "::say must return 0 in successive speech" do
      Mac::Say.say('42').must_equal 0
    end

    it "::say must use custom voice" do
      Mac::Say.say('42', :alex).must_equal 0
    end

    it "::say must work with multiple lines" do
      Mac::Say.say(<<-TEXT, :alex).must_equal 0
        1
        2
        3
      TEXT
    end
  end

  describe 'On an instance level' do
    before do
      @reader = Mac::Say.new
    end

    it 'must instantiate Mac::Say' do
      @reader.must_be_instance_of Mac::Say
    end

    it "#say must return 0 in successive speech" do
      @reader.say(string: 'yes').must_equal 0
    end
  end
end<commit_msg>chore: test build on push<commit_after>require 'helper'
require 'mac/say'

describe 'Mac::Say as a macOS `say` wrapper' do
  describe 'On a class level' do
    it "must have a VERSION constant" do
      Mac::Say.const_get('VERSION').wont_be_empty
    end

    it "must return available voices as an Array of Hashes" do
      Mac::Say.voices.wont_be_empty
      Mac::Say.voices.must_be_kind_of Array
    end

    it "must return specific Hash structure for a voice" do
      voice = Mac::Say.voices.first
      voice.wont_be_empty
      voice.must_be_kind_of Hash
      voice.keys.must_equal [:name, :iso_code, :sample]
    end

    it "must return specific Hash structure for an iso_code" do
      voice = Mac::Say.voices.first
      voice.wont_be_empty
      voice[:iso_code].must_be_kind_of Hash
      voice[:iso_code].keys.must_equal [:language, :country]
    end

    it "::say must return 0 in successive speech" do
      Mac::Say.say('42').must_equal 0
    end

    it "::say must use custom voice" do
      Mac::Say.say('42', :alex).must_equal 0
    end

    it "::say must work with multiple lines" do
      Mac::Say.say(<<-TEXT, :alex).must_equal 0
        1
        2
        3
      TEXT
    end
  end

  describe 'On an instance level' do
    before do
      @reader = Mac::Say.new
    end

    it 'must instantiate Mac::Say' do
      @reader.must_be_instance_of Mac::Say
    end

    it "#say must return 0 in successive speech" do
      @reader.say(string: '42').must_equal 0
    end
  end
end
{'fraction_non_alphanumeric': 0.09557109557109557, 'fraction_numerical': 0.009324009324009324, 'mean_word_length': 2.5804529201430273, 'pattern_counts': {'":': 6, '<': 7, '<?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': '6919625', 'n_tokens_mistral': 1052, 'n_tokens_neox': 980, 'n_words': 313}