spec/spec_helper.rb in te3270-0.7.1 vs spec/spec_helper.rb in te3270-0.8.0

- old
+ new

@@ -1,65 +1,61 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +require 'rspec' require 'te3270' if Gem.win_platform? require 'win32ole' require 'win32/screenshot' end -RSpec.configure do |config| - config.mock_with :rspec do |mocks| - mocks.syntax = :should - end -end def extra_system @extra_system ||= double('system') - @extra_system.stub(:Sessions).and_return extra_sessions - @extra_system.stub(:Version).and_return("0") + allow(@extra_system).to receive(:Sessions).and_return extra_sessions + allow(@extra_system).to receive(:Version).and_return("0") @extra_system end def extra_sessions @extra_sessions ||= double('sessions') - @extra_sessions.stub(:Count).and_return 0 - @extra_sessions.stub(:Open).and_return extra_session + allow(@extra_sessions).to receive(:Count).and_return 0 + allow(@extra_sessions).to receive(:Open).and_return extra_session @extra_sessions end def extra_session @extra_session ||= double('session') - @extra_session.stub(:Screen).and_return extra_screen - @extra_session.stub(:WindowState=) - @extra_session.stub(:Visible=) + allow(@extra_session).to receive(:Screen).and_return extra_screen + allow(@extra_session).to receive(:WindowState=) + allow(@extra_session).to receive(:Visible=) @extra_session end def extra_screen @extra_screen ||= double('screen') - @extra_screen.stub(:SelectAll).and_return extra_area + allow(@extra_screen).to receive(:SelectAll).and_return extra_area @extra_screen end def extra_area @extra_area ||= double('area') @extra_area end def quick_system @quick_system ||= double('quick_system') - @quick_system.stub(:ActiveSession).and_return quick_session - @quick_system.stub(:Visible=) + allow(@quick_system).to receive(:ActiveSession).and_return quick_session + allow(@quick_system).to receive(:Visible=) @quick_system end def quick_session @quick_session ||= double('quick_session') - @quick_session.stub(:Screen).and_return quick_screen - @quick_session.stub(:Open) - @quick_session.stub(:Connect) - @quick_session.stub(:Server_Name=) - @quick_session.stub(:Connected).and_return true + allow(@quick_session).to receive(:Screen).and_return quick_screen + allow(@quick_session).to receive(:Open) + allow(@quick_session).to receive(:Connect) + allow(@quick_session).to receive(:Server_Name=) + allow(@quick_session).to receive(:Connected).and_return true @quick_session end def quick_screen @quick_screen ||= double('screen')