Skip to content

Commit

Permalink
Merge dcdaf2e into ce15da9
Browse files Browse the repository at this point in the history
  • Loading branch information
sunaot committed Oct 9, 2019
2 parents ce15da9 + dcdaf2e commit d072a27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -14,4 +14,4 @@ test_script:
- bundle exec rake spec
environment:
matrix:
- ruby_version: "22"
- ruby_version: "26"
19 changes: 15 additions & 4 deletions spec/td/logger/treasure_data_logger_spec.rb
Expand Up @@ -3,10 +3,21 @@

describe TreasureData::Logger::TreasureDataLogger do
context 'init' do
it 'with apikey' do
td = TreasureData::Logger::TreasureDataLogger.new('db1', :apikey => 'test_1')
expect(td.instance_variable_get(:@client).api.apikey).to eq('test_1')
expect(td.instance_variable_get(:@client).api.instance_variable_get(:@ssl)).to eq(true)
require 'td-client'
if Gem::Version.create(TreasureData::Client::VERSION) > Gem::Version.create('0.8.83')
it 'with apikey' do
td = TreasureData::Logger::TreasureDataLogger.new('db1', :apikey => 'test_1')
expect(td.instance_variable_get(:@client).api.apikey).to eq('test_1')
expect(td.instance_variable_get(:@client).api.instance_variable_get(:@ssl)).to eq(true)
end
else
# for backward compatibility.
# Ruby '~> 2.0.0' depends on td-client-ruby '<= 0.8.83' and SSL is disabled by default in these versions.
it 'with apikey (Not HTTPS but HTTP was to be used as the default protocol in old td-client-ruby)' do
td = TreasureData::Logger::TreasureDataLogger.new('db1', :apikey => 'test_1')
expect(td.instance_variable_get(:@client).api.apikey).to eq('test_1')
expect(td.instance_variable_get(:@client).api.instance_variable_get(:@ssl)).to eq(false)
end
end

it 'with apikey and use_ssl' do
Expand Down

0 comments on commit d072a27

Please sign in to comment.