Sha256: ba9d95b241a4f35472d4412a4e8a0bf3dc5389bb6596c320175e80d99d0367a6

Contents?: true

Size: 926 Bytes

Versions: 1

Compression:

Stored size: 926 Bytes

Contents

$LOAD_PATH << File.join(File.dirname(__FILE__), "..", "lib")

require "keen"

describe Keen::Client do

  # The add_event method should add stuff to Redis:
  describe "#add_event" do

    # set up the Keen Client instance:
    project_id = "4f5775ad163d666a6100000e"
    auth_token = "a5d4eaf432914823a94ecd7e0cb547b9"

    # Make a client:
    client = Keen::Client.new(project_id, 
                              auth_token, 
                              :storage_class => Keen::Async::Storage::RedisHandler,
                              :logging => true )

    # Flush the queue first:
    client.clear_active_queue()

    # Send some events to the client, which should persist them in Redis
    5.times do
      client.add_event("rspec_clicks", {
        :hi => "you",
      })
    end

    # Make sure we have the right number of things in the queue:
    client.storage_handler.count_active_queue.should == 5

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
keen-0.1.0 test/keen_spec.rb