require 'unit/spec_helper'

module Infrataster
  # Infrataster contexts
  module Contexts
    describe DnsContext do
      subject { described_class.new(nil, nil).public_methods }
      it 'should have `have_entry` method' do
        is_expected.to include(:have_entry)
      end
      it 'should have `have_dns` method from rspec-dns' do
        is_expected.to include(:have_dns)
      end
    end
  end
end

require 'unit/spec_helper'

module Infrataster
  # Infrataster contexts
  module Contexts
    describe DnsContext do
      let(:server) { Server.new('ns.example.com', '192.168.33.10', :dns) }
      subject { described_class.new(server, nil) }
      it 'should have `have_entry` method' do
        matcher = double('matcher')
        allow(matcher).to receive(:config)
        allow(subject).to receive(:have_dns).and_return(matcher)
        subject.have_entry
      end
    end
  end
end

Replace tests have_entry with a test with stub
Replace tests have_entry with a test with stub
