# 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

# 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

Replace mocha syntax in Facter test
Replace mocha syntax in Facter test

Presumably changed by the upgrade to rspec/rspec-mocks. Fixes:
```
Failure/Error: Facter.fact(:fqdn).expects(:value).returns(fqdn)
NoMethodError:
 undefined method `expects' for #<Facter::Util::Fact:0x007fe85a5930b8>
```
