<commit_before># Put module's plugins on LOAD_PATH.
dir = File.expand_path('../../', File.dirname(__FILE__))
$LOAD_PATH.unshift File.join(dir, 'lib')

# We don't need rspec-puppet from spec_helper. Just facter.
require 'facter'

describe 'fqdn_underscore' do
  before :each do
    Facter.clear
  end

  {
    "host.example.com"    => "host_example_com",
    "host-1.example.com"  => "host-1_example_com",
  }.each do |fqdn, fqdn_underscore|
    describe "fqdn => #{fqdn}" do
      it {
        Facter.fact(:fqdn).should_receive(:value).and_return(fqdn)
        Facter.fact(:fqdn_underscore).value.should == fqdn_underscore
      }
    end
  end
end<commit_msg>[#52201615] Replace should_receive to expects, and_return to returns<commit_after># Put module's plugins on LOAD_PATH.
dir = File.expand_path('../../', File.dirname(__FILE__))
$LOAD_PATH.unshift File.join(dir, 'lib')

# We don't need rspec-puppet from spec_helper. Just facter.
require 'facter'

describe 'fqdn_underscore' do
  before :each do
    Facter.clear
  end

  {
    "host.example.com"    => "host_example_com",
    "host-1.example.com"  => "host-1_example_com",
  }.each do |fqdn, fqdn_underscore|
    describe "fqdn => #{fqdn}" do
      it {
        Facter.fact(:fqdn).expects(:value).returns(fqdn)
        Facter.fact(:fqdn_underscore).value.should == fqdn_underscore
      }
    end
  end
end
{'fraction_non_alphanumeric': 0.14212454212454212, 'fraction_numerical': 0.008791208791208791, 'mean_word_length': 3.435064935064935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4932901', 'n_tokens_mistral': 535, 'n_tokens_neox': 507, 'n_words': 104}