require 'spec_helper'

describe Stats do

  before(:each) do
    Stats.client = nil
  end

  after(:all) do
    Stats.client = nil
  end

  describe "not-inited" do
    it "write" do
        Stats.write('bleh', time: Time.now.to_i)
    end
  end

  describe "inited" do
    before(:each) do
      Stats.init(influxdb_database: 'test')
    end

    it "write" do
      # this can't pass unless there is an actual db listening
      Stats.write('bleh', time: Time.now.to_i)
    end
  end

end

