1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-03 17:55:52 +03:00

Extract Botan-related code from Client to Botan::ClientHelpers

Этот коммит содержится в:
Max Melentiev
2016-08-09 15:27:27 +06:00
родитель 27602b20bd
Коммит 85ff07de9b
5 изменённых файлов: 44 добавлений и 13 удалений

Просмотреть файл

@@ -0,0 +1,25 @@
RSpec.describe Telegram::Bot::Client do
let(:instance) { described_class.new(*client_args) }
let(:token) { 'token' }
let(:botan_token) { double(:botan_token) }
let(:client_id) { 'client_id' }
let(:client_args) { [token] }
describe '#botan' do
subject { instance.botan }
it { should eq nil }
context 'when botan token is set' do
let(:client_args) { [token, id: client_id, async: Class.new, botan: botan_token] }
it { should be_instance_of Telegram::Bot::Botan }
its(:token) { should eq botan_token }
end
context 'when botan is configured with hash' do
let(:client_args) { [token, id: client_id, async: Class.new, botan: botan_config] }
let(:botan_config) { {token: botan_token, async: Class.new} }
it { should be_instance_of Telegram::Bot::Botan }
its(:token) { should eq botan_token }
end
end
end

Просмотреть файл

@@ -41,15 +41,4 @@ RSpec.describe Telegram::Bot::Client do
its(:base_uri) { should include args[0][:token] }
end
end
describe '#botan' do
subject { instance.botan }
it { should eq nil }
context 'when botan token is set' do
let(:instance) { described_class.new token, botan: botan_token }
it { should be_instance_of Telegram::Bot::Botan }
its(:token) { should eq botan_token }
end
end
end