spec/input_responders/play_spec.rb in puppet-debugger-0.19.0 vs spec/input_responders/play_spec.rb in puppet-debugger-1.0.0

- old
+ new

@@ -1,9 +1,11 @@ +# frozen_string_literal: true + require 'spec_helper' require 'puppet-debugger/plugin_test_helper' describe :play do - include_examples "plugin_tests" + include_examples 'plugin_tests' describe 'convert url' do describe 'unsupported' do let(:url) { 'https://bitbuck.com/master/lib/log_helper.rb' } let(:converted) { 'https://bitbuck.com/master/lib/log_helper.rb' } @@ -94,11 +96,10 @@ end end describe 'multiple lines of input' do before(:each) do - end describe '3 lines' do let(:input) do "$var1 = 'test'\nfile{\"/tmp/${var1}.txt\": ensure => present, mode => '0755'}\nvars" end @@ -131,21 +132,17 @@ expect(output.string).to include('"test"') end end describe 'multiple lines puppet code' do let(:input) do - <<-EOF -if $osfamily { - $var = '3' -} -$var - EOF + <<~OUT + if $osfamily { + $var = '3' + } + $var + OUT end - xit do - plugin.play_back_string(input) - expect(output.string).to include('"3"') - end end end describe 'play' do let(:fixtures_file) do @@ -156,19 +153,12 @@ 'https://gist.github.com/logicminds/f9b1ac65a3a440d562b0' end let(:input) do "play #{file_url}" end - # requires internet and stops testing - xit 'url' do - allow(debugger).to receive(:fetch_url_data).with(file_url + '.txt').and_return(File.read(fixtures_file)) - debugger.handle_input(input) - expect(output.string).to match(/test/) - expect(output.string).to match(/Puppet::Type::File/) - end it 'file' do debugger.handle_input("play #{fixtures_file}") expect(output.string).to match(/Puppet::Type::File/) end end -end \ No newline at end of file +end