Sha256: d116850ac9dfcc9858806e8798914a1352a11d3c4933824d720a8e77ba53ec49
Contents?: true
Size: 1.72 KB
Versions: 9
Compression:
Stored size: 1.72 KB
Contents
require 'spec_helper' describe Indico do before do api_key = ENV['INDICO_API_KEY'] private_cloud = 'indico-test' @config = { api_key: api_key, cloud: private_cloud} end it 'should tag text with correct political tags' do expected_keys = Set.new(%w(Conservative Green Liberal Libertarian)) data = ['Guns don\'t kill people.', ' People kill people.'] response = Indico.political(data, @config) expect(Set.new(response[0].keys)).to eql(expected_keys) expect(Set.new(response[1].keys)).to eql(expected_keys) end it 'should tag text with correct political tags' do expected_keys = Set.new(%w(Conservative Green Liberal Libertarian)) response = Indico.political('Guns don\'t kill people. People kill people.') expect(Set.new(response.keys)).to eql(expected_keys) end it 'single political should return the right response' do expected_keys = Set.new(%w(Conservative Green Liberal Libertarian)) config = @config.clone config["version"] = 1 response = Indico.political('Guns don\'t kill people. People kill people.') expect(Set.new(response.keys)).to eql(expected_keys) end it 'batch political should return the right response' do expected_keys = Set.new(%w(Conservative Green Liberal Libertarian)) data = 'Guns don\'t kill people. People kill people.' config = @config.clone config["version"] = 1 response = Indico.political([data, data]) expect(response.length).to eql(2) expect(Set.new(response[0].keys)).to eql(expected_keys) expect(Set.new(response[1].keys)).to eql(expected_keys) end end
Version data entries
9 entries across 9 versions & 1 rubygems