Sha256: a3f9c1789d0823cf953435fa0e7f789633dff781a40026b62154fa070b424c55

Contents?: true

Size: 918 Bytes

Versions: 14

Compression:

Stored size: 918 Bytes

Contents

require 'spec_helper'

class String
  def to_string
    self
  end
end

class MockEvent
  def get_event_type
    'InvoiceCreationEvent'
  end

  def get_object_type
    'INVOICE'
  end

  def get_object_id
    '1234'
  end

  def get_account_id
    '11-22-33'
  end

  def get_tenant_id
    '1100-998'
  end
end

describe Klogger do

  before(:each) do
    Dir.mktmpdir do |dir|
      file = File.new(File.join(dir, 'klogger.yml'), "w+")
      file.write(<<-eos)
syslog:
  :enabled: false
irc:
  :enabled: false
email:
  :enabled: false
      eos
      file.close

      @plugin = Klogger::KloggerPlugin.new
      @plugin.logger = Logger.new(STDOUT)
      @plugin.conf_dir = File.dirname(file)

      # Start the plugin here - since the config file will be deleted
      @plugin.start_plugin
    end
  end

  it "should start and stop correctly" do
    @plugin.on_event MockEvent.new
    @plugin.stop_plugin
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
klogger-1.7.0 spec/klogger/integration_spec.rb
klogger-1.6.5 spec/klogger/integration_spec.rb
klogger-1.6.4 spec/klogger/integration_spec.rb
klogger-1.6.3 spec/klogger/integration_spec.rb
klogger-1.6.2 spec/klogger/integration_spec.rb
klogger-1.6.1 spec/klogger/integration_spec.rb
klogger-1.6.0 spec/klogger/integration_spec.rb
klogger-1.5.0 spec/klogger/integration_spec.rb
klogger-1.4.0 spec/klogger/integration_spec.rb
klogger-1.3.0 spec/klogger/integration_spec.rb
klogger-1.2.0 spec/klogger/integration_spec.rb
klogger-1.1.0 spec/klogger/integration_spec.rb
klogger-1.0.2 spec/klogger/integration_spec.rb
klogger-1.0.1 spec/klogger/integration_spec.rb