# encoding: utf-8 require 'spec_helper' describe Actions::ShowPacFile do let(:valid_pac_file) do <<-EOS.strip_heredoc.chomp function FindProxyForURL(url, host) { return "DIRECT"; } EOS end context '#initialize' do it 'requires a git repository' do expect { Actions::ShowPacFile.new(working_directory, 'proxy.pac') }.not_to raise_error end end context '#run' do it 'shows proxy.pac file' do repo = GitRepository.create(working_directory) repo.add_content('proxy.pac', 'asdf()') repo.add_content('proxy1.pac', 'asd1f()') action = Actions::ShowPacFile.new('proxy.pac', working_directory) result = capture(:stdout) do LocalPac.ui_logger.level = :info action.run end expect(result).to include('asdf()') end end end