spec/outputs/charrington_spec.rb in logstash-output-charrington-0.2.0 vs spec/outputs/charrington_spec.rb in logstash-output-charrington-0.2.1

- old
+ new

@@ -1,44 +1,64 @@ require_relative '../charrington_spec_helper' +require 'insist' describe LogStash::Outputs::Charrington do describe 'when initializing' do it 'shouldn\'t register without a config' do expect do LogStash::Plugin.lookup('output', 'charrington').new end.to raise_error(LogStash::ConfigurationError) end end + # describe 'integration tests with agent' do + # config <<-HEREDOC + # input { + # generator { + # message => '{"app_name": "Web App", "event": "From Agent"}' + # codec => 'json' + # count => 1 + # } + # } + + # output { + # charrington { + # connection_string => 'jdbc:postgresql://localhost:5432/winston?user=postgres&password=postgres' + # driver_jar_path => '/projects/logstash-output-charrington/vendor/postgresql-42.2.5.jar' + # schema => 'dea' + # } + # } + # HEREDOC + + # agent do + # puts "IT'S WORKING!!!!!" + # end + # end + describe 'integration tests' do - config <<-CONFIG - input { - generator { - message => '{"id": "abc", "app_name": "Web App", "event": "Hi - Dan"}' - codec => 'json' - count => 1 + let(:config) do <<-CONFIG + input { + generator { + message => '{"app_name": "Web App", "event": "Hi - Dan"}' + codec => 'json' + count => 1 + } } - } - output { - charrington { - connection_string => 'jdbc:postgresql://localhost:5432/winston?user=postgres&password=postgres' - driver_jar_path => '/projects/logstash-output-charrington/vendor/postgresql-42.2.5.jar' - schema => 'dea' + output { + charrington { + connection_string => 'jdbc:postgresql://localhost:5432/winston?user=postgres&password=postgres' + driver_jar_path => '/projects/logstash-output-charrington/vendor/postgresql-42.2.5.jar' + schema => 'dea' + } } - } - CONFIG + CONFIG + end - agent do - puts "IT'S WORKING!!!!!" + it("isn't effed") do + pipeline = new_pipeline_from_string(config) + pipeline.run end end - - # context 'running' do - # it 'should transform some JSON' do - # transformed = Charrington::Transform.call({"a" => 1}) - # puts transformed - # end - # end end