lib/telegram/bot/rspec/integration/shared.rb in telegram-bot-0.16.1 vs lib/telegram/bot/rspec/integration/shared.rb in telegram-bot-0.16.3

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + require 'active_support/json' require 'telegram/bot' require 'telegram/bot/rspec/message_helpers' require 'telegram/bot/rspec/callback_query_helpers' @@ -8,7 +10,7 @@ include_context 'telegram/bot/message_helpers' include_context 'telegram/bot/callback_query', :callback_query let(:bot) { Telegram.bot } let(:clear_session?) { described_class.respond_to?(:session_store) } - before { described_class.session_store.try!(:clear) if clear_session? } + before { described_class.session_store&.clear if clear_session? } end