Sha256: f006fefcfaf11ffe73bd111da30b66a67a2a2dd027504549eb3c8f0498643ad4
Contents?: true
Size: 1.03 KB
Versions: 6
Compression:
Stored size: 1.03 KB
Contents
Given /^an empty tracking database$/ do Metry.current.clear end Then /^there should be (\d+) tracking events?$/ do |event_count| assert_equal(event_count.to_i, Metry.current.event_count) end When /^there should be a tracking event "(\d+)":$/ do |id, table| event = Metry.current[id] assert event, "Unable to lookup event #{id}." table.hashes.each do |hash| expected = hash["value"] case expected when "_exists_" assert event[hash["key"]], "Key #{hash["key"]} does not exist." else assert_equal expected, event[hash["key"]], "Key #{hash["key"]} does not match." end end end Then /^there should be a visitor "([^\"]*)":$/ do |id, table| visitor = Metry.current.visitor(id) assert visitor, "Unable to lookup visitor #{id}." table.hashes.each do |hash| expected = hash["value"] case expected when "_exists_" assert visitor[hash["key"]], "Key #{hash["key"]} does not exist." else assert_equal expected, visitor[hash["key"]], "Key #{hash["key"]} does not match." end end end
Version data entries
6 entries across 3 versions & 1 rubygems